woodenpier
Member
Posted 3 years ago #
Hi,
I am trying to call a new header file if a user is logged in. My question is probably more about php than WordPress per-say, but I am already a member here and thought it would be faster to ask here.
I know that I can call text strings using echo with the <?php if ( is_user_logged_in() ) { ... } ?> function
But what should the code look like if I wanted to call a specific header file from the page file using the <?php get_header() ?>
Cheers!
-Zak
Something like:
<?php
if ( is_user_logged_in() ) {
get_header('loggedin'); // will include header-loggedin.php
} else {
get_header('notloggedin'); // will include header-notloggedin.php
}
?>
woodenpier
Member
Posted 3 years ago #
Thanks heaps.
I am a designer and know XHTML and CSS up and down. I know just enough PhP to get by with most WP templating (thanks to the codex!) but sometimes something simple get's in the way.
Cheers,
-Zak