Site logo

Archived topic

GP Hooks with login and logout

3 replies · Started by John on June 13, 2017

Viewing posts 1–4 of 4

Hello I have a website with two headers, one for logged in visitors and one for logged out visitors. I want to use GP Hooks to show one header when someone logs in and the other when they are logged out.
I know it is a simple PHP code to add to the hook menu but I am not very good with PHP and I do not know the variables to use for logged in and logged out.

Try this:

<?php if ( is_user_logged_in() ) { ?>
    Logged in header in here
<?php } else { ?>
    Logged out header in here
<?php } ?>

Thank you for your quick reply and it works perfectly, excellent.
Regards
John Carrell

You're welcome :)

This archived topic is closed to new replies.