Skip to content

Instantly share code, notes, and snippets.

View JiveDig's full-sized avatar

Mike Hemberger JiveDig

View GitHub Profile
@JiveDig
JiveDig / remove_genesis_widgets.php
Created May 10, 2013 19:29
Remove default/stock/standard Genesis widgets
<?php
// Remove eNews and Updates widget
add_action( 'widgets_init', 'remove_enews_updates_widget', 20 );
function remove_enews_updates_widget() {
unregister_widget( 'Genesis_eNews_Updates' );
}
// Remove Featured Page widget
add_action( 'widgets_init', 'remove_featured_page_widget', 20 );
// Add Video category sort
add_action( 'genesis_before_loop', 'jivedig_video_category_sort' );
function jivedig_video_category_sort() {
echo '<h1>Video Showcase</h1>';
$terms = get_terms('video_cat');
echo '<div class="video_cat-sort">';
echo '<div class="all-videos"><a href="/videos/">« ALL VIDEOS</a></div>';
foreach ($terms as $term) {
echo '<a href="'.get_term_link($term->slug, 'video_cat').'">'.$term->name.'</a>';
}
// Add category title and description to the Video Category taxonomy archives
add_action( 'genesis_before_content_sidebar_wrap', 'jivedig_video_cats_archive' );
function jivedig_video_cats_archive() {
echo '<div class="tax-title">';
echo '<p>All Videos Filed Under:</p>';
echo '<h2 class="archive-title">';
echo single_cat_title();
echo '</h2>';
echo '</div>';
}
@JiveDig
JiveDig / force_full_width.php
Created May 10, 2013 19:56
Force full width content layout
// Force full width content layout
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
// Unregister other site layouts
genesis_unregister_layout( 'sidebar-content' );
genesis_unregister_layout( 'content-sidebar-sidebar' );
genesis_unregister_layout( 'sidebar-sidebar-content' );
genesis_unregister_layout( 'sidebar-content-sidebar' );
@JiveDig
JiveDig / unregister_sidebars.php
Created May 10, 2013 19:59
Unregister other sidebars
// Unregister other sidebars
unregister_sidebar('sidebar-alt');
unregister_sidebar( 'header-right' );
@JiveDig
JiveDig / user_profile_custom_fields.php
Created May 10, 2013 20:01
Add and remove fields from user profile
// Add and remove fields from user profile
add_filter('user_contactmethods', 'modify_top_contact_methods', 0);
function modify_top_contact_methods($profile_fields) {
// Remove old fields
unset($profile_fields['aim']);
unset($profile_fields['yim']);
unset($profile_fields['jabber']);
// Add new fields
@JiveDig
JiveDig / gist:5557004
Created May 10, 2013 20:03
Remove Jetpack module from Dashboard for non-admins
// Remove Jetpack module from Dashboard for non-admins
function ap_remove_jetpack_page( ) {
if ( class_exists( 'Jetpack' ) && !current_user_can( 'manage_options' ) ) {
remove_menu_page( 'jetpack' );
}
}
add_action( 'admin_menu', 'ap_remove_jetpack_page', 999 );
// Disable OpenGraph in Jetback as written here: http://yoast.com/jetpack-and-wordpress-seo/
add_filter( 'jetpack_enable_opengraph', '__return_false', 99 );
@JiveDig
JiveDig / post_edit_link.php
Last active December 17, 2015 05:19
Remove the post edit link
// Remove the edit link
add_filter ( 'genesis_edit_post_link' , '__return_false' );
<div class="one-half first">
</div>
<div class="one-half">
</div>