Here’s what I have in my sidebar.php:
<aside id="sidebar">
<?php if ( is_user_logged_in() ) {
echo '<a href="https://wordpress.stackexchange.com/community"><img id="visit-the-forums" src="'. bloginfo('template_url') . '/images/visit-the-forums.png" alt="Check out the Forums!" /></a>'
} else {
echo '<a href="https://wordpress.stackexchange.com/community"><img id="join-the-forums" src="'. bloginfo('template_url') . '/images/join-the-forums.png" alt="Join the Forums!" /></a>'
}
?>
<a id="side-ad">
<img src="<?php bloginfo('template_url') ?>/images/ipad-ad.png" alt="iPad 2 Giveaway!" />
</a>
</aside>
For some reason, it doesn’t show (not even in the markup) for any of the pages. I’ve double-checked all of the other templates to make sure <?php get_sidebar(); ?>
is included. Is there something wrong w/ the code above?
Edit: I should note that the below works, that is, without the if/else statement.
<aside id="sidebar">
<a href="https://wordpress.stackexchange.com/community"><img id="join-the-forums" src="<?php bloginfo('template_url') ?>/images/join-the-forums.png" alt="Join the Forums!" /></a>
<a id="side-ad">
<img src="<?php bloginfo('template_url') ?>/images/ipad-ad.png" alt="iPad 2 Giveaway!" />
</a>
</aside>