Support

Account

Home Forums General Issues Sort by date Reply To: Sort by date

  • Hi @pansotdev

    I believe you can do it like this:

    $posts = get_posts(array(
    	'post_type'		=> 'post',
    	'posts_per_page'	=> -1,
    	'meta_key'		=> 'post-date',
    	'meta_value'		=> date("Ymd"),
    	'orderby'		=> 'meta_value_num',
    	'order'			=> 'ASC'
    ));

    Hope this helps.