• To filter “non-templated” pages — the pages with the default WordPress page.php behavior — you need to modify the metaquery to:

    
    array(
    	'meta_query' => array(
    		array(
    			'key'     => '_wp_page_template',
    			//'value'   => $template_files,
    			'compare' => 'NOT EXISTS',
    		)
    	),
    )
    

    I did that adding one more instance in the IF/ELSE statement on line #57. I created a new ELSEIF with “default”, just like the same as “all_missing”, and used the meta quert above. Please note I did comment out the VALUE and changed to “NOT EXISTS” only.

    Regards!
    G.

  • The topic ‘Not filtering DEFAULT template pages => SOLUTION here’ is closed to new replies.