Hide Nav Bar from guests (Works perfectly with Private BuddyPress)
-
Here’s something I would like to share. This edit was done in the header.php file of buddypress to hide the Nav Bar from guests and displays WordPress pages only.
<html xmlns='http://www.w3.org/1999/xhtml' > <meta http-equiv='Content-Type' content='; charset=" /> <title></title> <meta name='generator' content='WordPress " /> <!-- leave this for stats --> <link rel='stylesheet' href='" type="text/css" media="screen" /> <link rel='alternate' type='application/rss+xml' title=' | " href="" /> <link rel='alternate' type='application/rss+xml' title=' | | " href="" /> <link rel='alternate' type='application/rss+xml' title=' | | " href="" /> <link rel='alternate' type='application/rss+xml' title=' " href="" /> <link rel='alternate' type='application/atom+xml' title=' " href="" /> <link rel='pingback' href="" /> <body id="bp-default"> <div id="header"> <h1 id="logo"><a href='" title=""></a></h1> <ul id="nav"> <li class="selected"> <a href='" title=""></a></li> <!-- wp-pages transferred here --> <!-- edit if else statement --> <li class="selected"> <a href='//" title=""></a> </li> <li class="selected"> <a href='//" title=""></a> </li> <li class="selected"> <a href='//" title=""></a> </li> <li class="selected"> <a href='//" title=""></a> </li> <li class="selected"> <a href='//" title=""></a> </li> <!-- wp-pages edited from here --> <!-- to here --> <!-- edit if else statement endif --> <?php } //else else : { echo '<li><a href="http://yoursite.com/wp-login.php">Log In</a></li>'; } endif; ?> </ul><!-- #nav --> <div id="search-bar"> <div class="padder"> <form action='" method="post" id="search-form"> <input type='submit' name='search-submit' id='search-submit' value='" /> </form><!-- #search-form --> </div><!-- .padder --> </div><!-- #search-bar --> </div><!-- #header --> <div id="container">
Just replace
yoursite.com
with the URL of your site 🙂 Cheers!
- The topic ‘Hide Nav Bar from guests (Works perfectly with Private BuddyPress)’ is closed to new replies.