Support » Plugins » Help with a custom PHP script / wordpress

  • 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?

  • The topic ‘Help with a custom PHP script / wordpress’ is closed to new replies.