Created
April 29, 2013 16:00
-
-
Save lunaroja/5482574 to your computer and use it in GitHub Desktop.
Wordpress Query: Hide posts from home page based on meta key and still allow pagination.
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() ) { | |
global $wp_query; | |
$args = array_merge( $wp_query->query, array( | |
'meta_query' => array( | |
array( | |
'key' => 'hidefromhome', | |
'value' => 0 | |
) | |
) | |
) ); | |
query_posts( $args ); | |
}; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment