Wordpress Themes - WP Forum at BFA
Click Here To DONATE! Support the theme development, get more attention and additional benefits based on your donation level. Your forum name will be highlighted.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Header configuration & styling »

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


Build custom WP THEMES, without
coding.
Click here for THEMEFRAME

From the author of Atahualpa, the #1 most
downloaded (700,000+) theme @ wordpress.org
  #1  
Old Mar 21, 2010, 04:05 PM
marced
 
60 posts · Feb 2010
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!!

Last edited by marced; Mar 21, 2010 at 04:08 PM.
  #2  
Old Mar 21, 2010, 04:31 PM
juggledad's Avatar
juggledad
 
22,094 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
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>'';
__________________
If you like my help, please consider donating. I am happy to provide greater detail on this and other topics if you hire me. Please send detailed support requests to me as a private message, thank you.
Juggledad | Forum Moderator/Support
  #3  
Old Mar 22, 2010, 06:32 AM
marced
 
60 posts · Feb 2010
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.
  #4  
Old Mar 22, 2010, 10:08 AM
juggledad's Avatar
juggledad
 
22,094 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
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>';
};
__________________
If you like my help, please consider donating. I am happy to provide greater detail on this and other topics if you hire me. Please send detailed support requests to me as a private message, thank you.
Juggledad | Forum Moderator/Support

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Executing PHP Code in "HTML Inserts Header" Section twola Forum How-To 1 Sep 30, 2009 04:51 AM
Fatal error: Call to undefined function: is_tag() in bfa_get_options.php jmenge Atahualpa 3 Wordpress theme 2 Sep 8, 2009 06:10 AM
Adding php or function inside content Miak Post-Kicker, -Byline & -Footer 0 Sep 7, 2009 06:50 AM
[SOLVED] HELP! I tried to add something to my function.php page mgofootball Header configuration & styling 1 Jun 25, 2009 12:35 PM
[SOLVED] messed up header.php and footer.php monochrome Header configuration & styling 0 Jun 20, 2009 02:16 PM


All times are GMT -6. The time now is 07:41 AM.


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