Support

Account

Home Forums ACF PRO Group CPT Posts by ACF Select Field

Solved

Group CPT Posts by ACF Select Field

    • demo38

    • November 21, 2019 at 1:50 am

    Hello – I have a custom post type, and inside those posts, I have an ACF Select field.

    I’m stuck on a query for being able to grab all of the posts from the CPT and display them grouped conditionally, if there are any posts within any given select value.

    For instance, if there are 2 posts with an ACF Select field selection of Group 1, 1 that is in Group 3, and 3 in Group 7, would output:

    Group 1
    Item 1
    Item 2
    Group 3
    Item 1
    Group 7
    Item 1
    Item 2
    Item 3

    I have it partially working now, but using multiple queries (not as efficient) and without the conditional checks, so not ideal.

    Thanks for any insight

  • What is the current query you are using to get the posts without grouping?

    • demo38

    • November 22, 2019 at 5:37 am

    Thanks John – I was just in the process of reworking so that I’m using custom taxonomy as opposed to using the ACF field at all for that. Should be good to go now. Appreciate the help.

Viewing 3 posts - 1 through 3 (of 3 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.