WordPress.org

Forums

Posts 2 Posts
[resolved] How to list all the other related Posts (5 posts)

  1. sara cannon
    Member
    Posted 3 years ago #

    I have two CPT's.. one "places" and one "articles" that are connected through p2p.

    When I am on a place CPT page I can list all the articles. but when I'm on the Articles, I don't just want to list what place it is connected to, but all the other articles that are connected to the place that it is connected to. ex "Explore more articles connected to this place"

    I feel like there is an easy way to do this but I can't seem to place my finger on it.

    thank you.

  2. scribu
    Member
    Plugin Author

    Posted 3 years ago #

  3. iamdangavin
    Member
    Posted 3 years ago #

    I think she meant something like this. I posted a question on this topic as well.

    ps. this is some crazy hackery... but it is working...

    I am looping through to get the "places" ID and then within that loop I am looping through to get the "articles" associated to that specific "places" ID...

    [Code moderated as per the Forum Rules. Please use the pastebin]

  4. sara cannon
    Member
    Posted 3 years ago #

    Indeed! thank you!

  5. scribu
    Member
    Plugin Author

    Posted 3 years ago #

    I see. I made a tutorial specifically for this:

    http://github.com/scribu/wp-posts-to-posts/wiki/Related-posts

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Posts 2 Posts
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic