• Hi,

    I am using Apex with Morning child theme. I also have the Apex Pro plugin activated.

    I have an issue with the bbPress plugin where although the forum topic pages work, the forum main page does not display properly.

    I already contacted the bbPress forum and they were very helpful. They said there is a conflict with the theme, in that bbPress cannot locate the default page template. They pointed me to section 8 of this tutorial https://codex.bbpress.org/step-by-step-guide-to-setting-up-a-bbpress-forum/#8-make-sure-bbpress-uses-the-page-template-we-want

    Now the tutorial says bbPress can be forced to use the theme’s default page template. I believed it to be index.php so I created a duplicate in the apex theme root folder and renamed it to bbPress.php. It does not work. So index.php may not be the theme’s default page template or I am doing something else that is wrong.

    Can you please help out?

    Thanks in advance

    Regards,

    Stanley

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Theme Author Ben Sibley

    (@bensibley)

    Hi Stanley,

    We’ve added bbPress support to some of our themes but as you’ve noticed, it hasn’t been added for Apex quite yet. If you’d like to add support right away, I’ve got a few steps you can follow.

    First, add the following function into the functions.php file in the Morning child theme:

    function ct_apex_get_content_template() {
    
    // Get bbpress.php for all bbpress pages
    		if ( function_exists( 'is_bbpress' ) ) {
    			if ( is_bbpress() ) {
    				get_template_part( 'bbpress' );
    				return;
    			} 
    		}
    		if ( is_home() || is_archive() ) {
    			get_template_part( 'content-archive', get_post_type() );
    		} else {
    			get_template_part( 'content', get_post_type() );
    		}
    	}

    This is the function Apex uses to get the correct template for each page, and there’s an update here that allows it to check for a bbpress.php file on pages using bbPress.

    Next, add a new file to the Morning child theme and name it bbpress.php. Add the following content to that file:

    <div class='entry'>
    	<div class='entry-header'>
    		<h1 class='entry-title'><?php the_title(); ?></h1>
    	</div>
    	<div class='entry-content'>
    		<article>
    			<?php the_content(); ?>
    		</article>
    	</div>
    </div>

    Once you’ve made these changes, the main forum page will display properly.

    Thread Starter sdebo

    (@sdebo)

    Thank you for the code snippets. I implemented these. I now get a list of post entries in the main forum page (an improvement) instead of the intended list of forums. Is there a way to get a list of the forums instead please?

    I also get a duplicate title [TOPICS] for the page. I tried making some changes, but I could not remove the theme’s default page title. This is probably because I need to make changes to the default template file and I do not wish to do that without your help because I know too little about PHP.

    I left the change so that you may view it directly at https://fitamalta.eu/forums/

    Thank you,

    Stanley

    Theme Author Ben Sibley

    (@bensibley)

    Can you make sure the index.php has not been edited? If there have been any changes to it already, please download a new copy of Apex and copy the index.php file over.

    Do all of the forums have posts in them? bbPress can hide forums that don’t have public posts yet.

    Thread Starter sdebo

    (@sdebo)

    I will do as suggested and let you know. Thanks

    Thread Starter sdebo

    (@sdebo)

    Hi, it is now working fine, although I still get a list of latest topics instead of a list of the forums.

    With the code snippet your provided for the bbpress.php file the page was losing its formatting. I copied the call to the_post(); from the index.php file and formatting similar to the rest of the website is now retained also for the forum pages.

    Thank you again for your help.

    Regards,

    Stanley

    Theme Author Ben Sibley

    (@bensibley)

    Okay glad that part is working now.

    Do all of your forums have at least one public posts in them?

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘bbPress compatibility’ is closed to new replies.