Skip to:
Content
Pages
Categories
Search
Top
Bottom

bbpress should offer to login in forum

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

  • Robin W
    Moderator

    @robin-w

    If you want a quick solution to this

    create a directory within your theme called bbpress

    ie wp-content/your-theme-name/bbpress

    And into this folder copy the following file

    bbpress/templates/default/bbpress/form-reply.php

    Then alter this file to have a new line 175 as follows

    <p> <?php echo do_shortcode ('[bbp-login]') ; ?>
    

    so that

    <div id="no-reply-<?php bbp_topic_id(); ?>" class="bbp-no-reply">
    		<div class="bbp-template-notice">
    			<p><?php is_user_logged_in() ? _e( 'You cannot reply to this topic.', 'bbpress' ) : _e( 'You must be logged in to reply to this topic.', 'bbpress' ); ?></p>
    	</div>
    	</div>
    

    becomes

    <div id="no-reply-<?php bbp_topic_id(); ?>" class="bbp-no-reply">
    		<div class="bbp-template-notice">
    			<p><?php is_user_logged_in() ? _e( 'You cannot reply to this topic.', 'bbpress' ) : _e( 'You must be logged in to reply to this topic.', 'bbpress' ); ?></p>
    		<p> <?php echo do_shortcode ('[bbp-login]') ; ?>
    		</div>
    	</div>
    

    Save this file, and bbpress will use this and a login panel will be displayed.


    Robin W
    Moderator

    @robin-w

    Actually

    <p> <?php if (!is_user_logged_in()) echo do_shortcode ('[bbp-login]') ; ?>
    

    would be a better line of code, as then someone logged in with a spectator role would not see the login prompt


    arnieswap
    Participant

    @arnieswap

    Thanks. I have also created form-topic.php & form-form.php so that login shows up on forum page as well.

    Thanks a lot.


    Robin W
    Moderator

    @robin-w

    great, come back if you need further help

    Regards

    Robin

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