Tag Info

New answers tagged

-1

Simply add a conditional check. Example: <?php if ( is_active_sidebar( 'left-sidebar' ) && is_singular(array( page-slug-one, page-i.d-two ))) : ?> <?php dynamic_sidebar( 'left-sidebar' ); ?> Or change the conditional tag to something like is_page() <?php if ( is_active_sidebar( 'left-sidebar' ) && is_page()) : ...


0

You could probably do it my modifying the loop through the pre_get_posts hook. function wpse163459_search_exclude_post_format( $query ) { if( $query->is_main_query() && $query->is_search() ) { $tax_query = array( array( 'taxonomy' => 'post_format', 'field' => 'slug', 'terms' => array( ...


0

If you want to exclude posts from all queries, if you are not an "admin", and excluding the "single" query - so you can open the post, you can use this: add_action('pre_get_posts', 'exclude_posts_from_all_queries'); function exclude_posts_from_all_queries($query) { $exclude_posts = array('9'); if ( !is_admin() && !is_single() ) { ...



Top 50 recent answers are included