Created
March 18, 2016 19:15
-
-
Save QROkes/a2387c5e007d6def818d to your computer and use it in GitHub Desktop.
WordPress exclude posts from Loop.
This file contains hidden or 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', 'qr_exclude_tagged_posts' ); | |
function qr_exclude_tagged_posts( $query ) { | |
if ( $query->is_main_query() && $query->is_home() ) { | |
$query->set( 'tag__not_in', array( 63 ) ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment