Grow your CSS skills. Land your dream job.

WordPress Custom Post Types Issue

  • # May 8, 2013 at 8:12 am

    Hi there

    I am in the process of creating a site for a Tour Operator. Aside from the usual pages the bulk of the site consists of the following parent-child-grand child page structure, all with the ‘destinations’ page at the root. This example uses Africa as the child of the destinations page but the pattern is replicated many times over:

    http://www.sitename.com/destinations/

    – Africa (Uses ‘Region’ template)

    — Madagascar (Uses ‘Country’ template)

    — Accommodation (Uses ‘Accommodation Parent’ template)

    —- Holiday Inn (Uses ‘Accommodation’ template)

    — Itineraries (Uses ‘Itineraries Parent’ template)

    —- Madagascar Luxury Tour (Uses ‘Itinerary’ template)

    — Highlights (Uses ‘Highlights Parent’ template)

    —- Northern Rainforest (Uses ‘Highlights’ template)

    The issue I’m trying to resolve is how best to build the site given that each country page needs to return links to pages using the ‘Accommodation’, Itinerary’ and ‘Highlights’ templates, i.e. the 3 grandchild types. I also need to return links to the parent pages.

    This I could normally do with separate query posts on the page templates but I am wondering if I should be using Custom Post Types for Accommodation, Itinerary and Highlights pages? At present I am struggling to implement these pages and assign them to their correct place in the sitemap e.g. Creating an ‘Accommodation’ CPT leaves all accommodation pages as children of http://www.sitename.com/accommodation whereas I need multiple instances of ‘accommodation’ as a child of the respective ‘country’ page. This also obviously applies to the other parent page names.

    Any thoughts on how best to implement this would be great.

    Many thanks in advance

    # May 8, 2013 at 9:56 am

    Why not just use pages that the user selects a custom template for, the “accommodation” template for example? And then when they select that, appropriate custom fields appear for that page.

    # May 8, 2013 at 10:51 am

    Hi deeve007

    That’s exactly what I’m doing at the moment – custom templates with custom fields (using Advanced Custom Fields plugin). I just wanted to know if using CPTs would be more efficient

    The other issue – which I should probably have explained in the original post – is that I need to be able to query not only pages that children of the pages outlined above, but also have a search function where users can specify multiple Itinerary requirements with results returned in an archive style list. So I figured that creating taxonomies for these page types such as “5 star” “Honeymoon” “Safari” etc would be the most logical way to do this and that creating parent-child relationships of the CPTs would be the way to go?

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

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".