SeanAustin
Power Member
- Mar 4, 2013
- 781
- 736
Hey BHW
I'm on the quest of adding a forum to my site and am of course already having troubles
I have downloaded BBPress and installed it along with some other BBPress Plugins. I created a forum just fine and when I test it, I can see the forum perfectly fine. But the problem happens when I click on one of the topics. This is the screen I see for a post called "Test".

As you can see, the actual text from the post (which was "TESTING TIME. it's TESTING TIME" does not appear anywhere. The only thing that appears is the title and the response box. However, if I switch my theme to twenty-eleven, everything works great. So I assumed it was some coding in my theme file.
I did some searching and this was the closest fix I could find http://bbpress.org/forums/topic/forums-not-showing-up/
You don't need to read that but one of the responses was this:
So I went into my theme file, and since I am straight retarded when it comes to coding, I pretty much had no idea what to do.
This is the code for my page.php
If any awesome member here at BHW can help me out, that person will acquire so many karma points that they will be swimming in good luck for at least the next three weeks.
Cheers.
I'm on the quest of adding a forum to my site and am of course already having troubles
I have downloaded BBPress and installed it along with some other BBPress Plugins. I created a forum just fine and when I test it, I can see the forum perfectly fine. But the problem happens when I click on one of the topics. This is the screen I see for a post called "Test".

As you can see, the actual text from the post (which was "TESTING TIME. it's TESTING TIME" does not appear anywhere. The only thing that appears is the title and the response box. However, if I switch my theme to twenty-eleven, everything works great. So I assumed it was some coding in my theme file.
I did some searching and this was the closest fix I could find http://bbpress.org/forums/topic/forums-not-showing-up/
You don't need to read that but one of the responses was this:
I had the exact same problem, and have found a solution that worked for my case:
I have a custom theme running and the site.com/forums/ page was not listing the forums, even though I had created a couple sample forums and topics to make sure there was dummy data.
Thanks to Jared, it became quite apparent that the "the_content()" WordPress function was not properly generating the forum.
At first I tried disabling all the plugins, except bbpress, to see if perhaps a plugin was conflicting with the "the_content()" function; but no luck.
I then installed the TwentyTwelve theme, and switched to that, and voila, the forums were showing! Something was different in the TwentyTwelve theme that I didn't have in my custom theme... and I narrowed it down:
SOLUTION: Make sure you have the "the_post()" function call BEFORE the "the_content()" function, in your page.php template file in your theme folder. Something in bbPress must be getting triggered by the "the_post()" function which ties into the "the_content()" function displaying the forums content properly. All subsequent pages also display properly.
Simply, ensure "the_post()" is called before "the_content()". Did the trick for me! Good luck!
So I went into my theme file, and since I am straight retarded when it comes to coding, I pretty much had no idea what to do.
This is the code for my page.php
<?php
//set theme options
$oswc_page_sidebar_unique = $oswc_other['page_sidebar_unique'];
$oswc_trending_hide = $oswc_other['page_trending_hide'];
// use variables from page custom fields instead of made options page (if they exist)
$override = get_post_meta($post->ID, "Featured Image Size", $single = true);
if($override!="" && $override!="null") $oswc_featuredimage_size=$override;
$override = get_post_meta($post->ID, "Hide Trending", $single = true);
if($override!="" && $override!="null") {
$oswc_trending_hide=$override;
if($oswc_trending_hide=="false") {
$oswc_trending_hide=false;
} else {
$oswc_trending_hide=true;
}
}
//setup variables
$sidebar="Default Sidebar";
if($oswc_page_sidebar_unique) { $sidebar="Page Sidebar"; } //which sidebar to display
?>
<?php get_header(); // show header ?>
<div class="hide-responsive"><?php oswc_get_template_part('sharebox'); // show the sharebox ?></div>
<div class="main-content-left">
<div class="page-content">
<div class="content-panel">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php
// Featured Image for FB Like
$featured_image = get_the_post_thumbnail($post->ID);
// Get image source
if($featured_image) {
$doc = new DOMDocument();
$doc->loadHTML($featured_image);
$imageTags = $doc->getElementsByTagName('img');
foreach($imageTags as $tag) {
$image_url = $tag->getAttribute('src');
}
}
?>
<link rel="image_src" href="<?php echo $image_url; ?>" />
<h1><?php the_title(); ?></h1>
<?php if($oswc_featuredimage_size=="full" && has_post_thumbnail()) { ?>
<div class="article-image">
<?php the_post_thumbnail('single', array( 'title' => '' )); ?>
</div>
<?php } elseif($oswc_featuredimage_size=="medium" && has_post_thumbnail()) { ?>
<div class="article-image">
<?php the_post_thumbnail('single-medium', array( 'title' => '' )); ?>
</div>
<?php } elseif($oswc_featuredimage_size=="small" && has_post_thumbnail()) { ?>
<div class="article-image">
<?php the_post_thumbnail('single-small', array( 'title' => '' )); ?>
</div>
<?php } ?>
<div class="the-content">
<?php the_content(); ?>
</div>
<?php endwhile;
endif; ?>
</div>
</div>
<?php if(!$oswc_trending_hide) { ?>
<br class="clearer" />
<?php oswc_get_template_part('trending'); // show trending ?>
<?php } ?>
</div>
<div class="sidebar">
<?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar($sidebar) ) : else : ?>
<div class="widget-wrapper">
<div class="widget">
<div class="section-wrapper"><div class="section">
<?php _e(' Made Magazine ', 'made' ); ?>
</div></div>
<div class="textwidget">
<p><?php _e( 'This is a widget panel. To remove this text, login to your WordPress admin panel and go to Appearance >> Widgets, and drag & drop a widget into the corresponding widget panel.', 'made' ); ?></p>
</div>
</div>
</div>
<?php endif; ?>
</div>
<br class="clearer" />
<?php get_footer(); // show footer ?>
If any awesome member here at BHW can help me out, that person will acquire so many karma points that they will be swimming in good luck for at least the next three weeks.
Cheers.
Last edited: