Title: Help with a custom PHP script / wordpress
Last modified: August 18, 2016

---

# Help with a custom PHP script / wordpress

 *  [bigbrennan](https://wordpress.org/support/users/bigbrennan/)
 * (@bigbrennan)
 * [18 years, 9 months ago](https://wordpress.org/support/topic/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.

## Tags

 * [category](https://wordpress.org/support/topic-tag/category/)
 * [image](https://wordpress.org/support/topic-tag/image/)
 * [load image](https://wordpress.org/support/topic-tag/load-image/)
 * [php](https://wordpress.org/support/topic-tag/php/)

 * 0 replies
 * 1 participant
 * Last reply from: [bigbrennan](https://wordpress.org/support/users/bigbrennan/)
 * Last activity: [18 years, 9 months ago](https://wordpress.org/support/topic/help-with-a-custom-php-script-wordpress/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
