Skip to:

Here’s how to show bbPress info inside WordPress without full integration

  • _ck_


    I’m not sure if this has been addressed elsewhere already or a plugin already exists but for novices that have even just a beginner’s knowledge of how php+mysql works I want to show you how easy it is to show bbPress info inside of WordPress and vise-versa.

    You should NOT be using overly complex plugins like bbPress-Live or parsing RSS feeds if you have WordPress and bbPress sharing the same database but different tables. Instead, it’s a piece-of-cake to grab info from each other directly and display it. You don’t even need a plugin, you can code it right into your templates (as long as you know they will remain working together).

    So I’ll give some examples here and then if anyone has questions feel free to ask.

Viewing 10 replies - 51 through 60 (of 60 total)
  • Yep, you have to sanitize yourself, the database objects presume anything they’re passed has been already



    How exactly can I exclude some forums for showing up in this code, that generates a list of forums, or rather, HOW can i show only selected forums?

    <?php if ( $topic ) : ?>
    <h2>Forum List</h2>
    global $bbdb;
    $query="SELECT * FROM bb_forums WHERE topics!=0 ORDER BY forum_order ASC LIMIT 10";
    foreach ($results as $result) {
    echo "<li><a href='/forum.php?id=".$result->forum_id."'>".$result->forum_name."</a></li>";
    <?php endif; ?>



    SELECT * FROM bb_forums WHERE forum_id <> 1 AND forum_id <> 2 AND topics <> 0 ORDER BY forum_order ASC LIMIT 10

    Got the idea?



    Actually I don’t. I tried your code, but its still showing the same.



    This works for me quite well. May be you are doing something wrong!

    Can someone explain how I can pull the total number of bbpress posts made and display them in wordpress theme, and also a harder one to solve, how do I get the total number of posts for a user in bbpress and display that in the users wordpress author.php?

    I’ve got intergration happening with shared login/registrations, tables in same DB.

    Thanks for any help :)

    Markus Pezold


    Great Examples :) … I think these examples would be great in the documentation for bbPress.



    We might be able to guilt/nag Matt into getting a proper Wiki installed here once he gets WordPress 3 out the door (but then there will be 3.0.1 and 3.0.2 the week after, so maybe 2 weeks then, lol)



    This is my favorite topic of all time on – thanks _ck_



    I have verified that this code works. Created a github repository just for this topic. Code and instructions are included.

    <!– Add this code to functions.php –>

    add_theme_support( ‘post-thumbnails’, array( ‘forum’ ) );
    add_post_type_support(‘forum’, ‘thumbnail’);

    <!– Place this code inside page.php or anywhere else you can echo php in your theme –>

    <?php echo get_the_post_thumbnail($post_id, ‘full’); ?>

    <!– Repace $post_id with a number ’54’ which will be the id of the post you are tryin to fetch –>

    <?php echo get_the_post_thumbnail(’54’, ‘full’); ?>

Viewing 10 replies - 51 through 60 (of 60 total)
  • You must be logged in to reply to this topic.
Skip to toolbar