• Resolved gobi004

    (@gobi004)


    Hi,
    am using two post types cpt-1, cpt-2.and i have categories for cpt-1. i want to get related posts from these two cpts. i want to use tags instead of categories as common.

    and the single page of post need to display related posts from another post type .

    ie.
    cpt-1->single.php(single post) should have the cpt-2 s posts as related posts at the bottom of that page.
    how to map these by tags or something else? help me with this.

Viewing 1 replies (of 1 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Not something we have any sort of integration for, but the basic idea would be to do a custom WP_Query at the end of the single.php template, and have it query for posts from the other post type, that have any of the categories attached to the current post type’s post. For the sake of randomness and not receiving the same ones all the time, set it to be ordered randomly.

    CPTUI itself only does the registration of the post types, it doesn’t do anything in regards to display on the site.

Viewing 1 replies (of 1 total)
  • The topic ‘Related posts’ is closed to new replies.