• Resolved jerahepho

    (@jerahepho)


    Hello, just a general question.
    I’d like to query a custom post type and then order the results via a specific ACF field, which are the dates and times of events.
    Is this possible with the free or paid versions of GB and what would be the process please?

    Thank you

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support ying

    (@yingscarlett)

    Hi there,

    Are you using v1 or v2 blocks? If you are using v1 query loop block, then check this article for solution: https://docs.generateblocks.com/article/order-query-loop-by-custom-field/

    If you are using v2 query block, the solution still works, but add the class to the query block instead of the Grid block, and change the code generateblocks_query_loop_args to generateblocks_query_wp_query_args.

    Thread Starter jerahepho

    (@jerahepho)

    Hello Ying, we’re not using either at the moment, we’re looking for a solution and asked the question so we know in which direction to go. Good to know that we can at least attempt this with the free version

    Plugin Support ying

    (@yingscarlett)

    Yes, it can be done with the free version and some coding 🙂

    Thread Starter jerahepho

    (@jerahepho)

    Hello Ying,
    Thank you for your assistance with this. I can confirm we have this working with the free plug-in and after adding the code, by following your instructions. Initially, we forgot to change the code “generateblocks_query_wp_query_args”, and bizarrely it still worked, but we’ve remedied it now, just to be on the safe side

    Thank you

    • This reply was modified 1 year, 1 month ago by jerahepho.
    Plugin Support ying

    (@yingscarlett)

    The generateblocks_query_wp_query_args filter is for v2 query block, and generateblocks_query_loop_args filter is for v1 query block.

    Glad you’ve got it working 🙂

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Ordering a query by ACF field’ is closed to new replies.