Using conditional tags in sidebar

4 replies
To display a couple of images in the sidebar only on the blog page of my WordPress site, I'm using this:

Code:
<?php if ( is_page('6') ) { ?>
<div id="border"><p><img src="http://mi-trale.org/wp-content/uploads/2011/04/filename1.jpg"/></p>
<div id="captions"><caption>caption text here</caption></div>

<p><img src="http://mi-trale.org/wp-content/uploads/2011/04/filename2.jpg"/></p>
<div id="captions"><caption>caption text here</caption></div>
<?php } ?>
It works fine for all the pages except for this blog page. (I installed WP on the root, but I assigned a static page as the home page and chose a different page to display the posts.) Does anyone know why it doesn't work on that page?
#conditional #sidebar #tags

Trending Topics