bigbrennan Posted August 8, 2007 Share Posted August 8, 2007 I have posted this on the WordPress forum and have had no joy, could anyone here offer some advice? Hi guys, We have created a small PHP script which will load a particular image dependent on which category the blog is posted in. On our website index (index.php) we have the following codes: Header: <?php require('blog/wp-blog-header.php'); ?> Body: <?php if(get_the_category_list(', ')=="john-virgo") { ?> <img src="images/top5.jpg" width="100" height="100" alt="" /> <?php } elseif(get_the_category_list(', ')=="something") { ?> <img src="image2.jpg" width="100" height="100" alt="" /> <?php } ?> But this is not working correctly. If I set the criteria to be 'uncategorized' then it will load the image, but any other category title and it won't. Any ideas? Link to comment https://forums.phpfreaks.com/topic/63866-loading-image-dependent-on-category/ Share on other sites More sharing options...
pranav_kavi Posted August 8, 2007 Share Posted August 8, 2007 wat does get_the_category_list() method contain?? Link to comment https://forums.phpfreaks.com/topic/63866-loading-image-dependent-on-category/#findComment-318332 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.