Title: Programmatically Assign Templates From Plugin
Last modified: August 24, 2016

---

# Programmatically Assign Templates From Plugin

 *  [Gemfruit](https://wordpress.org/support/users/gemfruit/)
 * (@gemfruit)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/programmatically-assign-templates-from-plugin/)
 * Is there a way to programmatically assign which template a custom taxonomy should
   use? I have the following Custom Post Types, and Taxonomies, using the Genesis
   framework:
 * Dining (custom post type)
 * dining_types (custom taxonomy)
    -restaurants (term) -cafes (term) -delis (term)-
   street vendors (term)
 * Lodging (custom post type)
 * lodging_types (custom taxonomy)
    -hotels (term) -inns (term) -bed and breakfasts(
   term) -resorts (term)
 * Rather than create 8 templates, I could dynamically use the term name to serve
   related content (I have this working with a Page setup right now, but I’m switching
   to custom post types and taxonomies). Is there any way to simply tell all 8 of
   those terms to use “special-template.php” or whatever naming convention would
   be needed? The only detail is that they all need to use the same file, or at 
   least 1 file per custom Taxonomy.
 * This could would preferably go in my site-specific plugin, or functions.php.

The topic ‘Programmatically Assign Templates From Plugin’ is closed to new replies.

## Tags

 * [custom](https://wordpress.org/support/topic-tag/custom/)
 * [post](https://wordpress.org/support/topic-tag/post/)
 * [taxonomy](https://wordpress.org/support/topic-tag/taxonomy/)
 * [template](https://wordpress.org/support/topic-tag/template/)
 * [term](https://wordpress.org/support/topic-tag/term/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [Gemfruit](https://wordpress.org/support/users/gemfruit/)
 * Last activity: [11 years, 1 month ago](https://wordpress.org/support/topic/programmatically-assign-templates-from-plugin/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
