Thread Starter
csleh
(@csleh)
I forgot I can add links in this forum. You can see what I mean here:
http://www.puritanautomation.com/datafiles/?page_id=14
the two left columns — the second (inner) one has a different background color depending on category. I’m trying to get the photo in the first one differnt depending on category as well. THat info is in sidebar-left.php
Perhaps there is a way to query the post, get the category, then do an echo?
Thread Starter
csleh
(@csleh)
OK, I don’t need to do this — was overthinking the issue. I found some conditional tags that do the trick BUT if I try to use an image instead of just text, the site below the header comes back blank. For every page, even the ones in a different category.
So new question — how can I use an image in a conditional comment as seen below?
<?php
// let's generate info appropriate to the page being displayed
if (in_category(9)) {
echo "<p>we are in category automation</p>";
} elseif (in_category(8)) {
echo "<p>we are in category test</p>";
} else {
echo "<p>this is anything else</p>";
} // That's all, folks!
?>
I’ve tried:
echo "<img src="<?php bloginfo('template_directory'); ?>/images/brose1.jpg" alt="test system image" />";
<img src="<?php bloginfo('template_directory'); ?>/images/brose1.jpg" alt="test system image" />; (no echo)
`echo “<img src=”fullurlcopiedfrombrowser.jpg” />;
The image does display — if you visit the site you’ll see the text is on top of that image. So link seems correct.
Thread Starter
csleh
(@csleh)
looking for something completely different, found this on “the undersigned” blog:
`<?php if ( is_single(’slug’) ) { ?>
<img src=”” alt=”” / />
<?php } ?>’
works like a charm!