Support

Account

Home Forums ACF PRO Sort custom post types by subfields

Solved

Sort custom post types by subfields

  • Is it possible to sort custom post types according to a subfield?

    for example,

    A Plot is a custom post type containing a group with the following fields;

    Name,
    Size,
    Number

    Is it possible to use either get_posts() or WP_query() to get a bunch of Plots and to sort them by one of the subfields?

    Something similar to this but for a subfield within a group would be ideal.

    Thanks!

  • No, you cannot sort by sub fields. Each sub field has a different meta_key. See my post here https://acfextras.com/dont-query-repeaters/

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.