Reply To: Adding Login To Bottom of Forums and Topics
Old topic to be chiming in on but this helped a lot, thanks @tharsheblows!
I changed it up to simply add buttons to the pages instead of the login form, and made sure that upon login, it redirected back to the topic or forum.
//this adds the login and register links underneath on a single topic so someone can leave a reply. It uses the same logic as form-reply
function mjj_new_reply_login(){
if( !bbp_current_user_can_access_create_reply_form() && !bbp_is_topic_closed() && !bbp_is_forum_closed( bbp_get_topic_forum_id() ) ){ ?>
<a href="<?php echo wp_login_url( get_permalink() ); ?>" title="Login">Login</a>
<a href="<?php echo wp_registration_url(); ?>">Register</a>
<?php
}
}
add_action('bbp_template_after_single_topic', 'mjj_new_reply_login');
//this adds the llogin and register links underneath on a single forum so someone can start a topic. It uses the same logic as form-topic
function mjj_new_topic_login(){
if( !bbp_current_user_can_access_create_topic_form() && !bbp_is_forum_closed() ){ ?>
<a href="<?php echo wp_login_url( get_permalink() ); ?>" title="Login">Login</a>
<a href="<?php echo wp_registration_url(); ?>">Register</a>
<?php
}
}
add_action('bbp_template_after_single_forum', 'mjj_new_topic_login');
I personally did them as buttons, if you have a .button class just add class="button" between <a and href=.
Hope that helps someone in the future.