My php variables are not being printed out. -
<?php if ( is_user_logged_in() ) { echo '<a href="/community"><img id="visit-the-forums" src="<?php bloginfo('template_url') ?>/images/visit-the-forums.png" alt="check out forums!" /></a>' } else { echo '<a href="/community"><img id="join-the-forums" src="<?php bloginfo('template_url') ?>/images/join-the-forums.png" alt="join forums!" /></a>' } ?> i think there wrong w/ way set "php bloginfo" code inside i'm not sure how fix it.
the code below should work you. had make use of string concatenation:
<?php if ( is_user_logged_in() ) { echo '<a href="/community"><img id="visit-the-forums" src="' . bloginfo('template_url'). '/images/visit-the-forums.png" alt="check out forums!" /></a>' } else { echo '<a href="/community"><img id="join-the-forums" src="' . bloginfo('template_url') . '/images/join-the-forums.png" alt="join forums!" /></a>' } ?>
Comments
Post a Comment