CPT-onomies: Using Custom Post Types as Taxonomies
Relatiing bbpress forum and post by tit (2 posts)

  1. eternal noob
    Posted 4 years ago #

    I have bbpress installed. And CPT-onomies. I make a post with the title of xyz. I then make a forum insie bbpress and call it xyz.

    Can I now use CPT-onomies to show me the topics of that forum (the xyz-forum) when I am reading the post(the xyz-post) as a widget, shortcode or template tag ?



  2. Rachel Carden
    Plugin Author

    Posted 4 years ago #

    I don't know that much about bbPress so I can't help you retrieve the topics of a forum, but if you're trying to relate forums to posts, CPT-onomies can do the trick.

    All you would have to do is attach your "forums" to your "posts" (you can take care of this in the settings panel) and then, while editing your post, assign your forum "xyz" to your post "xyz".

    Placing the following code in your template will return an array of post IDs for all the forums that are related to the post you're viewing.

    wp_get_object_terms( $post->ID, 'forums', array( 'fields' => 'ids' ) );

    Then it would just be a matter of using the forum post id(s) retrieve the topics.

    I hope this was helpful.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic


No tags yet.