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?
Using conditional tags in sidebar
5
To display a couple of images in the sidebar only on the blog page of my WordPress site, I'm using this:
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?
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 } ?> - theIMgeek
- [ 1 ] Thanks
- Laura B
- [2] replies
- reygcalantaol
- [ 1 ] Thanks
- alexacc
Next Topics on Trending Feed
-
5