bbpress 2.0 plugin: Adding a log in/out link to the top of every forum page
-
Hello,
I have sorted out my migration from a standalone 1.0 installation in a separate db to a 2.0 plugin installation on my own, and now I would like to restore the functionality of bbpress 1.0 of having a log in/out link and a username for the logged-in user at the top of every forum page. I don’t want this at the top of every page on my site, just on every forum page. Here is the approximate code I would use if I were to add this to a WP header somewhere:
<?php if ( is_user_logged_in() ) { ?>
get_currentuserinfo();
<p>
echo ‘Welcome ‘ . $current_user->user_login . Click here to log out“n”;
</p>
<?php } else { ?>
<p>” title=”Login”>Log in to post if you are registered, or /wp-register.php”>register an account.</p>
<?php } ?>
Can someone help me integrate the same functionality into bbp-common-template.php or wherever it ought to go in order to be shown on every forum page but not on any pages that aren’t part of my forum? I would like it to appear right below the breadcrumbs on every page.
While I’m here, I’d like to strongly recommend building this functionality into the bbpress plugin, since there are probably many people other than me who don’t want to encourage login attempts (or use up primary menu navigation space) for any pages other than their dedicated forums.
Thank you!
- You must be logged in to reply to this topic.