Forums

Is this Possible? Post Types - Related Posts (5 posts)

  1. WebFlair
    Member
    Posted 7 months ago #

    Here's what I want to do... (is it possible?)

    I am writing a tourism website and I want several Post types... Towns, Hotels, Restaurants, Tourist Attractions etc

    Now say I write a post about a Town, let say Blackpool in England, and that post contains lots of information about that town for tourists.

    Then I write another post about a hotel in Blackpool, and another post about a tourist attraction in Blackpool.

    I would like for main Blackpool post to have a section that shows hotels in Blackpool, Restaurants in Blackpool and Tourist attractions in blackpool, which themselves will be other posts.

    If that makes sense. Is it possible?

  2. esmi
    Theme Diva & Forum Moderator
    Posted 7 months ago #

  3. WebFlair
    Member
    Posted 7 months ago #

    So I have looked at the pages you mention above, thanks, I think I will be able to fathom that with time.

    Save me wrongly going down this route, will these multiple loops allow me to...

    1st loop: The post about blackpool (Title, author, post content)

    2nd loop: List of Posts with type 'hotel' and tagged 'blackpool' (For each: Title linked to full post, summary text, post image)

    3rd loop: List of Posts with type 'restaurants' and tagged 'blackpool' (For each: Title linked to full post, summary text, post image)

    ?

    Hopefully I will be able to work out the PHP for these loops.

  4. esmi
    Theme Diva & Forum Moderator
    Posted 7 months ago #

    Yep - that all sounds about right to me. :-)

  5. WebFlair
    Member
    Posted 7 months ago #

    Sorry, can anyone help. I;ve tried to work this out but I can work out how to code the multiple loop..

    Single Post template

    1st loop is the standard post loop

    2nd loop shows all posts that have any matching tag to the main post and are of post type Hotel.

    3rd loop shows all posts that have any matching tag to the main post and are of post type Attraction.

Reply

You must log in to post.

About this Topic