1 comment

  1. Here’s how I finally got around not being able to do the above

    <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; ?>
    
    <?php
    
    $excluded_key = "main_story";
    $excluded_val = array("Main", "Secondary", "Third");
    $exclude_ids  = array();
    
    ?>
    
    <?php
    
    foreach ($excluded_val as $exclude) {
    
        $args = array(
            'posts_per_page'  => 1,
            'order'                     => 'DESC',
            'meta_query'            => array(
                array(
                    'key'               => $excluded_key,
                    'value'             => $exclude,
                    )
                )
            );
    
        $excluded_id = get_posts($args);
    
        foreach($excluded_id as $to_exclude) {
            $exclude_ids[] = $to_exclude->ID;
        }
    }
    
    
    ?>
    
    <?php
    
    $args = array(
        'post__not_in'      => $exclude_ids,
        'paged'                     => $paged
        );
    
        ?>
    
        <?php $the_query = new WP_Query( $args ); ?>
    
        <?php if ( $the_query->have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
    

Comments are closed.