Wordpress posts order by custom field -


i have 2 types of posts - event , news. event category, have custom filed - event_date. news not have field. want order posts according event_date (i want include news though dont have event_date field ). have tried this:

$args = array(             'cat'               => $categories,             'posts_per_page'    => $display_count,             'post_type'         => 'post',             'number'            => $display_count,             'page'              => $page,             'offset'            => $offset,             'meta_key'          => 'event_date',             'orderby'           => 'meta_value_num',             'order'             => 'asc'         );         $query = new wp_query($args); 

this query not return of news. because news dont have order field? if so, how can solve problem? thinking of ordering multiple like-

'orderby'=> 'meta_value_num date' 

but no luck.


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -