0

I am able to display posts ordered by custom meta key using the pre_get_posts action. How ever, it is leaving out (not displaying) posts without this meta key. Is there any way to display the posts with out the meta key at the end?

$q->set( 'meta_key', '_1m_e_date' );
$q->set( 'orderby', 'meta_value' );
$q->set( 'order', 'ASC' ); 

Thank you

  • I believe this might be expected behaviour – Tom J Nowell Feb 23 at 2:32
  • Yes sir. The question is: Is there any way to display the posts with out the meta key at the end? – karlosuccess Feb 23 at 3:23
  • maybe a meta query with both EXISTS and NOT EXISTS clauses. – Milo Feb 23 at 4:01