Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Montezuma Theme (http://forum.bytesforall.com/forumdisplay.php?f=53)
-   -   [SOLVED] Welcome / logout text at the top right (http://forum.bytesforall.com/showthread.php?t=19912)

zibzab Mar 17, 2013 05:22 AM

[SOLVED] Welcome / logout text at the top right
 
Hi, I love the montezuma theme - just one thing I'd like to add if possible.

Above the menus in the header, I'd like to add some text that knows if a user is logged in. If they are logged in, it says Welcome "First Name" and then shows the option to log-out. If they are not logged in, then there is no message displayed.

Is this easy to do - any help would be much appreciated.

Cheers


Just to add, I have used the following code in other themes and it has worked great. Just need to know how to add this to Montezuma.

Code:

<?php global $user_identity; if ($user_identity): ?>
<h2 class="site-description">
<?php global $current_user;
      get_currentuserinfo();
        echo 'Welcome ' . $current_user->user_firstname ; ?>

 – (<a href="<?php bloginfo('wpurl'); ?>/wp-login.php?action=logout" title="Logout">Logout</a>)</h2>
<?php endif; ?>

Any ideas?

zibzab Mar 17, 2013 10:31 AM

Hi, I have used this code in a different theme and it does what I want – hoever, it doesn't appear correctly in Montezuma.

Code:

<?php global $user_identity; if ($user_identity): ?>
<h2 class="site-description">
<?php global $current_user;
      get_currentuserinfo();
        echo 'Welcome ' . $current_user->user_firstname ; ?>

 – (<a href="<?php bloginfo('wpurl'); ?>/wp-login.php?action=logout" title="Logout">Logout</a>)</h2>
<?php endif; ?>

Can anyone help?

zibzab Mar 17, 2013 10:33 AM

Just to add, I've used the following code on a different theme and it works fine - just not sure how to add this to Montezuna.

Code:

<?php global $user_identity; if ($user_identity): ?>
<h2 class="site-description">
<?php global $current_user;
      get_currentuserinfo();
        echo 'Welcome ' . $current_user->user_firstname ; ?>

 – (<a href="<?php bloginfo('wpurl'); ?>/wp-login.php?action=logout" title="Logout">Logout</a>)</h2>
<?php endif; ?>

Any ideas?

juggledad Mar 17, 2013 11:37 AM

you need to add a 'Dynamic Sidebar' (see the limited php code) and then add your code into it and have a plugin like widget logic.

zibzab Mar 17, 2013 11:55 AM

Hi, sorry I'm not sure what you mean by "'Dynamic Sidebar' (see the limited php code)". I need this to go above the menu items - not as a sidebar widget. Is this possible?

zibzab Mar 17, 2013 12:00 PM

Hi, just seen the Limited Php section.

With this in mind, is there a way of getting what I want into the header, or is it almost impossible?

juggledad Mar 17, 2013 12:12 PM

the label 'dynamic sydbar' is mis leading, it should say 'dynamic widget area'
so add one in the header

zibzab Mar 17, 2013 12:26 PM

Hi, thanks for helping. I'm not sure where or what I should be adding the dynamic widget!

Sorry to sound stupid, but could you give me a bit more info please. I'm not a developer.


Thanks

juggledad Mar 17, 2013 01:33 PM

Copy the sample code and put it in the hearer.php virtual template, then go to the widget area and you will see the new area and you can add a widget into it

Experiment a little, play with it, best way to learn

zibzab Mar 17, 2013 03:32 PM

Hi, with a bit more rooting around I have managed to do it - looks good.

After trying unsuccessfully to create my own widget I found a plug-in called executable-php-widget which allowed me to create what I wanted.

Job done. Thanks.


All times are GMT -6. The time now is 08:09 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.