Skip to content

Instantly share code, notes, and snippets.

View JiveDig's full-sized avatar

Mike Hemberger JiveDig

View GitHub Profile
// Remove default sidebar text
remove_action( 'genesis_sidebar', 'genesis_do_sidebar' );
add_action( 'genesis_sidebar', 'beatminded_do_default_sidebar' );
/**
* Echo primary sidebar default content.
*/
function beatminded_do_default_sidebar() {
if ( ! dynamic_sidebar( 'sidebar' ) ) {
echo '';
// Change default sidebar text
remove_action( 'genesis_sidebar', 'genesis_do_sidebar' );
add_action( 'genesis_sidebar', 'beatminded_do_default_sidebar' );
/**
* Echo primary sidebar default content.
*/
function beatminded_do_default_sidebar() {
if ( ! dynamic_sidebar( 'sidebar' ) ) {
echo '<div class="widget widget_text"><div class="widget-wrap">';
// Unregister WordPress default widgets
add_action('widgets_init', 'unregister_default_widgets', 11);
function unregister_default_widgets() {
unregister_widget('WP_Widget_Pages');
unregister_widget('WP_Widget_Calendar');
unregister_widget('WP_Widget_Archives');
unregister_widget('WP_Widget_Links');
unregister_widget('WP_Widget_Meta');
/* unregister_widget('WP_Widget_Search'); */
/* unregister_widget('WP_Widget_Text'); */
// Remove menus from Dashboard
add_action('admin_menu', 'remove_menus');
function remove_menus () {
global $menu;
// Removes all pages in this array
$restricted = array(__('Dashboard'), __('Posts'), __('Media'), __('Links'), __('Pages'), __('Appearance'), __('Tools'), __('Users'), __('Settings'), __('Comments'), __('Plugins'));
end ($menu);
while (prev($menu)){
$value = explode(' ',$menu[key($menu)][0]);
if(in_array($value[0] != NULL?$value[0]:"" , $restricted)){unset($menu[key($menu)]);}
@JiveDig
JiveDig / gist:5700439
Last active July 19, 2019 23:49
Register videos custom post type
// Register 'videos' Post Type
if ( ! function_exists('jivedig_videos_post_type') ) {
function jivedig_videos_post_type() {
$labels = array(
'name' => _x( 'Videos', 'themename' ),
'singular_name' => _x( 'Video', 'themename' ),
'menu_name' => __( 'Videos', 'themename' ),
'parent_item_colon' => __( 'Parent Video:', 'themename' ),
'all_items' => __( 'All Videos', 'themename' ),
'view_item' => __( 'View Video', 'themename' ),
@JiveDig
JiveDig / gist:5700466
Created June 3, 2013 19:03
Register The "Video Categories" and "Video Tags" Custom Taxonomies
// ------------------------------ Video Categories
if ( ! function_exists('jivedig_video_category_taxonomy') ) {
// Register Custom Taxonomy
function jivedig_video_category_taxonomy() {
$labels = array(
'name' => 'Video Categories',
'singular_name' => 'Video Category',
'menu_name' => 'Video Categories',
'all_items' => 'All Video Categories',
@JiveDig
JiveDig / gist:5700922
Created June 3, 2013 20:04
An example of HBO's embed code the offer via their website
<iframe src="http://www.hbo.com/data/content/global/videos/embed/data/1271213.html?height=288&width=512" height="288" width="512" style="overflow:hidden" scrolling="no" seamless="seamless" frameborder="0" type="text/html"></iframe><div><a title="Miami Dolphins: Series Preview" href="http://www.hbo.com/video/video.html/?autoplay=true&vid=1271213&filter=hard-knocks&view=null">Miami Dolphins: Series Preview</a></div>
@JiveDig
JiveDig / gist:5700958
Last active December 18, 2015 00:59
Embed a video from YouTube, Vimeo, or HBO using custom fields created in Advanced Custom Fields
<?php
/**
Template for single Videos posts
*/
/** Embed the video from custom fields */
add_action( 'genesis_post_content', 'jivedig_do_video_single', 1 );
function jivedig_do_video_single() {
$video_url = get_field( "video_url" );
$iframe_url = get_field( "iframe_url" );
@JiveDig
JiveDig / gist:5754159
Last active December 18, 2015 08:29
Fix checkbox and radio button styling in Genesis
input[type="checkbox"],
input[type="radio"] {
width: 20px;
margin: 0 0 3px 3px;
vertical-align: middle;
}
@JiveDig
JiveDig / gist:5815383
Last active December 18, 2015 16:59
Remove the comma from the category and tag list in Genesis
//* Remove the comma in the entry meta in the entry footer (requires HTML5 theme support)
add_filter( 'genesis_post_meta', 'post_meta_filter' );
function post_meta_filter($post_meta) {
$post_meta = '[post_categories sep=""] [post_tags sep=""]';
return $post_meta;
}