Title: Include PHP file depending on category
Last modified: August 20, 2016

---

# Include PHP file depending on category

 *  [HappyCloud](https://wordpress.org/support/users/happycloud/)
 * (@happycloud)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/include-php-file-depending-on-category/)
 * How can I include a different PHP depending on what category name the current
   post is linked to?
 * For example;
 * If the current post is in category = DVD then I want to be able to show dvd.php
   and if the current post is in category = CD then I want to be able to show cd.
   php
 * I am using custom post types, if that makes a difference.
 * Any help would be great.

The topic ‘Include PHP file depending on category’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [HappyCloud](https://wordpress.org/support/users/happycloud/)
 * Last activity: [14 years, 9 months ago](https://wordpress.org/support/topic/include-php-file-depending-on-category/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
