Home Forums Front-end Issues List Posts Based on Field Value


List Posts Based on Field Value

  • I have a “Tour” custom post type and I’ve tagged my tours such as “adventure” “ATV” “Scuba” etc. I’m using advanced custom fields for my tags b/c the custom post type doesn’t support more than one category and it also doesn’t support standard WP tags.

    How can I create pages that list out my tours based on the value of my tag field? For example if I want to create a page called /romantic-tours how can I show all the tours that I have “tagged” as romantic in advanced custom fields?

  • Your comment about the custom post type not supporting more than one category confuses me. What you’re trying to do would be best done using a custom taxonomy that’s attached to your custom post type. Using a custom taxonomy would give you a way to have pages bases on each term easily.

    To do it using a custom field you’ll need to create templates for each of the “Tags” and do a custom WP_Query for each. For more information on querying posts based on custom fields see this how to:

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

You must be logged in to reply to this topic.