outkax (@outkax)

Forum Replies Created

Viewing 8 replies - 1 through 8 (of 8 total)

  • outkax
    Participant

    @outkax

    I found the answer to my problem. The problem is a conflict between Yoast SEO and BBPress


    outkax
    Participant

    @outkax

    Thanks for your answer I have corrected my code with yours 🙂


    outkax
    Participant

    @outkax

    I think I found the solution 🙂 :

    <?php
    
    /**
     * Single Forum Content Part
     *
     * @package bbPress
     * @subpackage Theme
     */
    
    // Exit if accessed directly
    defined( 'ABSPATH' ) || exit;
    
    ?>
    
    <div id="bbpress-forums" class="bbpress-wrapper">
    
    	<?php bbp_breadcrumb(); ?>
    
    	<?php //bbp_forum_subscription_link(); ?>
    
    	<?php do_action( 'bbp_template_before_single_forum' ); ?>
    
    	<?php if ( post_password_required() ) : ?>
    
    		<?php bbp_get_template_part( 'form', 'protected' ); ?>
    
    	<?php else : ?>
    
    		<?php //bbp_single_forum_description(); ?>
    
    		<?php if ( bbp_has_forums() ) : ?>
    
    			<?php bbp_get_template_part( 'loop', 'forums' ); ?>
    
    		<?php endif; ?>
    
    		<?php if ( ! bbp_is_forum_category() && bbp_has_topics() ) : ?>
    
    			<?php bbp_get_template_part( 'pagination', 'topics'    ); ?>
    
    			<?php bbp_get_template_part( 'loop',       'topics'    ); ?>
    
    			<?php bbp_get_template_part( 'pagination', 'topics'    ); ?>
    
    			<?php bbp_get_template_part( 'form',       'topic'     ); ?>
    
    		<?php elseif ( ! bbp_is_forum_category() ) : ?>
    			<?php if(bbp_get_forum_id() === $forum_id = 513): ?>
    
    				<?php bbp_get_template_part( 'rules' ); ?>
    
    			<?php else :  ?>
    				<?php bbp_get_template_part( 'feedback',   'no-topics' ); ?>
    
    				<?php bbp_get_template_part( 'form',       'topic'     ); ?>
    			<?php ?>
    			<?php endif; ?>
    		<?php endif; ?>
    
    	<?php endif; ?>
    
    	<?php do_action( 'bbp_template_after_single_forum' ); ?>
    
    </div>
    

    outkax
    Participant

    @outkax

    I tried another method but no way bbp_forum_id only displays the forum id.I tried with I tried with “bbp_get_forum_id” that doesn’t work either.

    <div id="bbpress-forums" class="bbpress-wrapper">
    
    	<?php bbp_breadcrumb(); ?>
    
    	<?php //bbp_forum_subscription_link(); ?>
    
    	<?php do_action( 'bbp_template_before_single_forum' ); ?>
    
    	<?php if ( post_password_required() ) : ?>
    
    		<?php bbp_get_template_part( 'form', 'protected' ); ?>
    
    	<?php else : ?>
    
    		<?php //bbp_single_forum_description(); ?>
    
    		<?php if ( bbp_has_forums() ) : ?>
    
    			<?php bbp_get_template_part( 'loop', 'forums' ); ?>
    
    		<?php endif; ?>
    
    		<?php if ( ! bbp_is_forum_category() && bbp_has_topics() ) : ?>
    
    			<?php bbp_get_template_part( 'pagination', 'topics'    ); ?>
    
    			<?php bbp_get_template_part( 'loop',       'topics'    ); ?>
    
    			<?php bbp_get_template_part( 'pagination', 'topics'    ); ?>
    
    			<?php bbp_get_template_part( 'form',       'topic'     ); ?>
    
    		<?php elseif ( ! bbp_is_forum_category() ) : ?>
    			<?php if(bbp_forum_id() === '513'): ?>
    			<?php echo 'yes'; ?>
    			<?php else :  ?>
    				<?php bbp_get_template_part( 'feedback',   'no-topics' ); ?>
    
    				<?php bbp_get_template_part( 'form',       'topic'     ); ?>
    			<?php ?>
    			<?php endif; ?>
    		<?php endif; ?>
    
    	<?php endif; ?>
    
    	<?php do_action( 'bbp_template_after_single_forum' ); ?>
    
    </div>

    outkax
    Participant

    @outkax

    I tested with your code Robin, it does not work. The if is missing parentheses. But even with that doesn’t work. It displays all the forums with the content of the if and does not take into account the id I give it.


    outkax
    Participant

    @outkax

    With the query monitor plugin, I see that I have to use a php page like this : single-forum-rules.php. Rules being my slug. I create a page single-forum-rules.php but it does not work. It always takes the page.php file. But if I remove the “-rules” it works I have a white page with written “page rules load”…

    Any idea how to force it to find the right page?


    outkax
    Participant

    @outkax

    no one has any ideas?


    outkax
    Participant

    @outkax

    Up

Viewing 8 replies - 1 through 8 (of 8 total)