Hi there, I want to show all my guests (non registered members) on the blog a simple register banner. But i dont want the banner to be visible to members (already registered) How can i do this... show content to only guest?
Before you publish a post in the upper right you have these options: Public Password Protected Private. Have you given them a try? This may not be what you are asking but it kind of sounds like it.
If a guest is anyone who isn't logged in then you can update the template (or write a plugin) that uses is_user_logged_in If you need to know even if they aren't logged in then you'll probably need to set a cookie and check for that.
<?php if ( is_user_logged_in() ) { echo 'Welcome, registered user!'; } else { echo 'Welcome, visitor!'; ,//change here }; ?> Code (markup): put this code in ur template
Yup this looks good... this is wht i was looking for... Can you just let me know, is it ok if i replace the welcome text with a banner like this... <?php if ( is_user_logged_in() ) { echo '<a href="www.google.com><img scr="somelinklink"/></a>'; } else { echo '<a href="www.google.com><img scr="someotherlink"/></a>'; ,//change here }; ?>
yes it is okay to replace text message with banner <?php if ( is_user_logged_in() ) { echo '<a href="link"><img src="image location"></a>' ; } else { echo '<a href="link"><img src="image location"></a>' ; }; ?> Code (markup):
as Sarah mentioned you can add some plugins to your WP. Just search "private post" in wordpress.org plugins section.
ya... but this won't be a post or a page... I want to show/hide a banner in the header of my theme...