use an href within an if/else statement
-
I’m trying to show a different image, with a link, depending on whether a user is logged in or not.
What I’d like to do would be something like this:
<?php if ( is_user_logged_in() ) { <A HREF="/"><IMG SRC="<?php bloginfo('template_directory'); ?>/images/createblog.jpg" border="0"></A> } else { <A HREF="/"><IMG SRC="<?php bloginfo('template_directory'); ?>/images/createblogloggedout.jpg" border="0"></A> }; ?>
However, as it doesn’t allow commands within the statement, I can’t figure out how to do it.
How would I show an image within that structure?
Thanks
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘use an href within an if/else statement’ is closed to new replies.