Excluding posts by meta, and also keeping posts without the meta
I think I managed to solve this. What I did was to add the following in my functions.php file: add_filter( ‘posts_where’, ‘exclude_my_posts’ ); function exclude_my_posts( $where ) { global $wpdb; // For the front page. Hide posts with “efter15” set to “Ja”, and only show posts with “show_on_front_page” set to “Nej” if (is_front_page()) { return … Read more