Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to have specific template forum-loop and topic-loop ?


  • pmatteudi
    Participant

    @pmatteudi

    Hi there,

    I’m writing because I have trouble to understand how templates are managed in BBPress (and wordpress I guess :)).
    I’d like to have a specific template on the main forum page (the one displaying the different forums). And another template for the page displaying the different topics.

    Currently in the wordpress page where I pasted the short code [bbp-forum-index], I call the template bbpress.php, which is presented in the bbpress codex (See example at the end of the topic).

    But how can I create a specific template for my forum index (listing all my forums), for instance “forum-display.php”. And another template, listing my topics (for instance “topic-display.php”).

    Maybe my file bbpress.php is not appropriate to do so ? or need to be customized a bit ?

    NB : I’m using twenty twelve theme

    I hope my question is clear,
    Thank you for your help,
    Pierre

    <?php
     
    /*
    Template Name: index-forum
    */
     
    get_header(); ?>
      
    <div id="primary" class="site-content">
     
    		<div id="content-forum" role="main">
    	 
    	 
    		<?php
    		/*
    		Start the Loop
    		*/
    		
    		while ( have_posts() ) : the_post(); ?>
    		 
    		 
    		<?php
    		/*
    		This is the start of the page and also the insertion of the post classes.
    		 
    		Post classes are very handy to style your forums.
    		*/
    		?>
    		 
    			<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    			<?php
    			/*
    			This is the title wrapped in a header tag
    			and a class to better style the title for your theme
    			*/
    			?>
    		 
    			<header class="entry-header">
    			 
    			<h1 class="entry-title"><?php the_title(); ?></h1>
    			 
    			</header>
    			 
    			 
    			<?php
    			/*
    			This is the content wrapped in a div
    			and class to better style the content
    			*/
    			?>
    		 
    			<div class="entry-content">
    			<?php the_content(); ?>
    			</div>
    			 
    			<!-- .entry-content -->
    			 	 
    			</article>
    			 
    			<!-- #post -->
    			<?php endwhile; // end of the loop. ?>
    		 
    		</div>
    	 	<!-- #content -->
    	 	
    	 	<div class="login-sidebar"><?php dynamic_sidebar('forum_login_zone');?></div>
    
    </div> 
    	<!-- #primary -->
      
    <?php
    /*
    This is code to display the sidebar and the footer.
    Remove the sidebar code to get full-width forums.
    This would also need CSS to make it actually full width.
    */
    ?>
    		 
    <?php get_footer(); ?>
  • You must be logged in to reply to this topic.
Skip to toolbar