This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Register before-content widget | |
genesis_register_sidebar( array( | |
'id' => 'before-content', | |
'name' => __( 'Before Content', 'agency' ), | |
'description' => __( 'This is the before-content section.', 'agency' ), | |
) ); | |
// Hook before-post widget to single page | |
add_action( 'genesis_before_content_sidebar_wrap', 'custom_before_content', 9 ); | |
function custom_before_content() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if (is_home() ) { ?><p>Insert-HTML-Code-Here</p><?php } ?> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php /* | |
Template Name: Exclude Categories | |
*/ | |
/** Custom Genesis loop */ | |
remove_action( 'genesis_loop', 'genesis_do_loop' ); | |
add_action( 'genesis_loop', 'child_do_custom_loop' ); | |
function child_do_custom_loop() { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'pre_get_posts', 'exclude_category_posts' ); | |
/** | |
* @author Brad Dalton - WP Sites | |
* @example http://wpsites.net/web-design/exclude-category-posts-page/ | |
*/ | |
function exclude_category_posts( $query ) { | |
if( $query->is_main_query() && $query->is_home() ) { | |
$query->set( 'cat', array( -27, -30 ) ); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Code for one category | |
<?php if ( is_home() ) { query_posts( 'cat=-1' ); } ?> | |
//Code for multiple categories | |
<?php if ( is_home() ) { query_posts( 'cat=-1,-2,-3' ); } ?> | |
/** | |
* @author Brad Dalton - WP Sites | |
* @example http://wp.me/p1lTu0-9OJ | |
*/ | |
// Change conditional tag to remove posts from displaying on blog or other pages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function unregister_widgets() { | |
unregister_widget('WP_Widget_Pages'); | |
unregister_widget('WP_Widget_Calendar'); | |
unregister_widget('WP_Widget_Archives'); | |
unregister_widget('WP_Widget_Meta'); | |
unregister_widget('WP_Widget_Search'); | |
unregister_widget('WP_Widget_Text'); | |
unregister_widget('WP_Widget_Categories'); | |
unregister_widget('WP_Widget_Recent_Posts'); | |
unregister_widget('WP_Widget_Recent_Comments'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'sidebars_widgets', 'remove_homepage_widgets' ); | |
function remove_homepage_widgets( $sidebars_widgets ) { | |
if ( is_home() ) | |
$sidebars_widgets = array( false ); | |
return $sidebars_widgets; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter ('sidebars_widgets', 'remove_specific_pages_widget'); | |
function remove_specific_pages_widget( $sidebars_widgets ){ | |
if (is_page('007')) | |
$sidebars_widgets ['sidebar'] = false; | |
return $sidebars_widgets; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function remove_wordpress_widgets() { | |
unregister_widget('WP_Widget_Pages'); | |
unregister_widget('WP_Widget_Calendar'); | |
unregister_widget('WP_Widget_Archives'); | |
unregister_widget('WP_Widget_Meta'); | |
unregister_widget('WP_Widget_Search'); | |
unregister_widget('WP_Widget_Text'); | |
unregister_widget('WP_Widget_Categories'); | |
unregister_widget('WP_Widget_Recent_Posts'); | |
unregister_widget('WP_Widget_Recent_Comments'); |
OlderNewer