Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

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

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


  #1  
Old Mar 21, 2010, 04:05 PM
marced
 
60 posts · Feb 2010
Unhappy 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!!

Last edited by marced; Mar 21, 2010 at 04:08 PM.
  #2  
Old Mar 21, 2010, 04:31 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
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>'';
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
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
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
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>';
};
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
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 01:35 AM.


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