add_action( 'pre_get_posts', function( $query ) { // Only run on the public site and avoid admin/dashboard queries if ( is_admin() ) { return; } // Target the candidate post type query $post_type = $query->get( 'post_type' ); if ( in_array( $post_type, [ 'candidate', 'candidates' ], true ) || is_post_type_archive( 'candidate' ) ) { $meta_query = $query->get( 'meta_query' ); if ( ! is_array( $meta_query ) ) { $meta_query = []; } // Keep your working Year filter and add the General Election condition $meta_query['relation'] = 'AND'; $meta_query[] = [ 'key' => 'in_the_general_election', 'value' => '1', 'compare' => '=', ]; $query->set( 'meta_query', $meta_query ); } }, 20 );

Watch or Listen to Behind The Beacon! 

Top 5

Follow Us

Sign up for our weekly newsletter

* indicates required

Our news. your inbox.

Once a week, we will send a digest of all our stories to your inbox.

Help Shape Our coverage

Help Us Hit $5,000 by
Election Day!

Between October 1 and November 3, we’re aiming to raise $5,000 to power our newsroom and keep our reporting free for everyone who needs it.

If you value facts, accountability, and community‑rooted coverage, give at your capacity today. Every contribution helps us reach our goal and sustain independent journalism in Bucks County.