Forums

Join
bbPress Support ForumsTroubleshootingcompare WordPress tags to BBpress tags. Relevant posts.

Info

compare WordPress tags to BBpress tags. Relevant posts.

  1. Hi, I'm trying to list topics from the forum in a WP post. I'm wanting to just show the topics that have the same tags as the particular post that is being viewed.

    This is basically a display relevant posts. How can this be done? I've tried a bunch of PHP, but I'm not having luck navigating the codex between the two databases. I've mucked around alot, but I can't get beyond the basic display the last 10 posts functionality.

    Here's where I'm at: HELP?

    <?php

    global $wpdb;
    $query="SELECT * FROM bb_topics WHERE topic_status=0 ORDER BY topic_time DESC LIMIT 10";
    $results=$wpdb->get_results($query);

    foreach ($results as $result) {echo "

  2. topic_id."'>".$result->topic_title."
  3. ";}
    ?>

  • Did you get this work already?

  • anyone?

  • This is fairly simple to do, but you have to define exactly what you want it to do.

    i.e. Are you looking for forum topics that include any of the Tags in the blog post? This means that there will be no ordering or weighting on relavancy.

    This line of WP code will help you on your way too:

    $tags = wp_get_post_tags($post->ID);

  • I want the same as the relevant posts plugin does but also for the forum.

    If the blogpost in WP has the same tags as a forum topic i want to show the links on the blogpost with relevant forum posts.

    Can this be done?

  • Yes :)

    Just remember that users set tags, and users are notoriously useless.
    Especially if your forum / blog is not aimed at technical people (who have, to a certain degree, become used to the idea of tags for cross pollination).

  • Thnx for your answer KEvin, how can this be done?

  • You must log in to post.