Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Header configuration & styling (http://forum.bytesforall.com/forumdisplay.php?f=15)
-   -   Connect html with php function in header, almost there... (http://forum.bytesforall.com/showthread.php?t=6382)

marced Mar 21, 2010 04:05 PM

Connect html with php function in header, almost there...
 
Hi all,

I replaced the RSS Feed icons with my own code (links), to have it nicely sit on top of the search bar and in the header area. I am almost there (www.marced.com, second line top right), in the bfa_header_config.php file I edited the code:

$logo_area .= '<a href="/contact">Contact</a> | <a href="/feed" >RSS</a> | <a href="javascript:bookmarksite(\'MARCED.com\', \'http://www.marced.com\')">Favorieten</a> | <a href="/wp-login.php?action=register">Registreren</a>'; Works great.

Now I also want to add a link to it, that says logout (when logged in) or login (when not logged in). In a widget, I used the php function wp_loginout(); . I can use this one, but how do I add it to the string above, I am using html and php then. My code knowledge stops here.

I tried using a dot and then wp_loginout(); after the code, but then it shows up in a weird position..

Please help, should be simple I guess if you know code?

Thnx!!

juggledad Mar 21, 2010 04:31 PM

just use
HTML Code:

$logo_area .= '<a href="/contact">Contact</a> | <a href="/feed" >RSS</a> | <a href="javascript:bookmarksite(\'MARCED.com\', \'http://www.marced.com\')">Favorieten</a> | <a href="/wp-login.php?action=register">Registreren</a> | <a href="/wp-login.php?action=login">login</a>'';

marced Mar 22, 2010 06:32 AM

Hi Juggledad,

This doesn't change the text does it? It always sais login then, I want it to say logout when already logged in. (actually I want the name of the logged in user when logged in and logout, but logout is also good).

So I want the text to be dynamic.

juggledad Mar 22, 2010 10:08 AM

well you could code an php if
change the code to this
HTML Code:

$logo_area .= '<a href="/contact">Contact</a> | <a href="/feed" >RSS</a> | <a href="javascript:bookmarksite(\'MARCED.com\', \'http://www.marced.com\')">Favorieten</a> | <a href="/wp-login.php?action=register">Registreren</a>';
if ( is_user_logged_in() ) {
    $logo_area .= '| <a href="/wp-login.php?action=logout">logout</a>';
} else {
    $logo_area .= '| <a href="/wp-login.php?action=login">login</a>';
};



All times are GMT -6. The time now is 05:48 PM.

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