Home Forums General Issues Custom query order by …


Custom query order by …

  • Hello,

    i need your help plz 🙂

    I have this ACF fields :

    – type (checkbox type)
    – date with datepicker

    I have to order all my post with type = “mytype” (can we use ID ?) and order by date DESC

    How can i do this plz ?

    Thanks a lot.

    i did it :

    $prez = get_posts(array(
    ‘post_type’ => ‘myposttype’,
    ‘numberposts’ => -1,
    ‘meta_key’ => ‘date’,
    ‘orderby’ => ‘meta_value’,
    ‘order’ => ‘DESC’

    but it’s not working.

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.