Title: Referencing template names
Last modified: August 30, 2016

---

# Referencing template names

 *  [mattrtrevino](https://wordpress.org/support/users/mattrtrevino/)
 * (@mattrtrevino)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/referencing-template-names/)
 * How do I reference a unique template name inside another template?
    Example: 
   template-contactform.php /* Template Name: X Contact Form */ [insert code here]

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [Happy Coders](https://wordpress.org/support/users/happy-coders/)
 * (@happy-coders)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/referencing-template-names/#post-6334939)
 * Hello there,
 * Can you please clarify a bit further regarding this?Or you may go through the
   template hierarchy documentation to understand clearly regarding the template.
   Below link may help you.
 * [https://developer.wordpress.org/themes/basics/template-hierarchy/](https://developer.wordpress.org/themes/basics/template-hierarchy/)
 * Thanks.
 *  Thread Starter [mattrtrevino](https://wordpress.org/support/users/mattrtrevino/)
 * (@mattrtrevino)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/referencing-template-names/#post-6334944)
 * Normally I would use an include to pull in another template page but this case
   calls for an iframe.
 * I’m trying to do the following, but it isn’t working
    `<iframe scr="/xcontactform"
   ></iframe>`
 * Am I linking the template correctly?
 *  [Happy Coders](https://wordpress.org/support/users/happy-coders/)
 * (@happy-coders)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/referencing-template-names/#post-6334947)
 * Hello there,
 * Is there any specific reason doing that i.e including the template file within
   another template file may be ambiguous for pages in which those templates have
   been assigned.
 * If you require to use specific portion of the templates then keep all the codes
   of the specific portion to the different php file and include that php file in
   both the templates using php include function.
 * Thanks.
 *  Thread Starter [mattrtrevino](https://wordpress.org/support/users/mattrtrevino/)
 * (@mattrtrevino)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/referencing-template-names/#post-6334992)
 * This particular template has some custom styling outside of the normal style 
   sheets. It was faster and easier to just bundle all in one little template.
 *  [catacaustic](https://wordpress.org/support/users/catacaustic/)
 * (@catacaustic)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/referencing-template-names/#post-6335066)
 * To use a template inside another one…
 * `<?php eho get_template_part( 'template-contactform' ); ?>`

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Referencing template names’ is closed to new replies.

## Tags

 * [name](https://wordpress.org/support/topic-tag/name/)
 * [template](https://wordpress.org/support/topic-tag/template/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 5 replies
 * 3 participants
 * Last reply from: [catacaustic](https://wordpress.org/support/users/catacaustic/)
 * Last activity: [10 years, 10 months ago](https://wordpress.org/support/topic/referencing-template-names/#post-6335066)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
