Jump to content
osgzach

Dynamic Register/Login/Out link in Brandnav?

Recommended Posts

osgzach    1
osgzach

Hi,

 

I am hoping this wouldn't be a complicated modification to do myself -  and possibly  in a way that I don't have to modify any main Pagelines templates themselves  (I am using the Customize Plugin)..   But I kind of have the feeling I may need to.. Then again I am asking here because I have no flipping clue :sword:

 

So http://www.oldskoolgames.com'>This is my site.  As you can see, I have a  "BrandNav" type setup (I believe),  a navigation menu right below my site logo,  serving as the main menu to link to other pages on the site.

 

You can also see my temporary solution where I just hardcoded a  "Register/Login"  link by adding a custom link to the  login.php  page,  and then applied some custom CSS to that menu item (didn't think it was gonna work, nice they are treated as individual units) to pad it all the way to the right margin of the menu.

 

 

But I would like a real dynamic text link to be there instead..   One that will change with the users status.   If they are not logged in, or register  it would say   "Register/Login",  but once they are logged in,  I want it to change to show  "Logout"  only.

 

It's very late (12am) here, but I did a little light reading,  and one page I found discussed how to add such a dynamic link to your site,  but was focused on doing a simple footer modification,  and what I assume was some custom PHP in  one or two files..

 

 

Unfortunately that doesn't really help me understand what I would need to modify in  Pagelines to get it to show up in the Menu there.    Can anyone possibly help me out,  and get me started ?

Share this post


Link to post
Share on other sites
Danny    1,327
Danny

Hi,

 

The simplest method would be to use CSS and the logged-in class, which is applied to the body when logged in. However, the best method would be to use a hook with the Wordpress conditional tags.

 

http://codex.wordpress.org/Function_Reference/is_user_logged_in

 

Using the conditional tags would require knowledge of PHP, but the outcome will be better than using the CSS method and look more professional.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
osgzach    1
osgzach

Thanks, I will research both of these options when I have the time this weekend :)

Share this post


Link to post
Share on other sites
Rob    547
Rob

Great. 


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×