Created
January 12, 2012 17:08
-
-
Save micahwave/1601778 to your computer and use it in GitHub Desktop.
Hide posts on homepage 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
/** | |
* Where filter to hide posts on the homepage query | |
*/ | |
function time_hide_posts_where( $where ) { | |
global $wpdb; | |
if( is_home() || is_front_page() ) { | |
$where .= " AND $wpdb->posts.ID NOT IN ( SELECT m.post_id FROM $wpdb->postmeta AS m WHERE m.meta_key = 'time_hide_on_home' AND m.meta_value = 1 )"; | |
} | |
return $where; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment