Title: Code to get template name
Last modified: August 19, 2016

---

# Code to get template name

 *  Resolved [thadfiebich](https://wordpress.org/support/users/thadfiebich/)
 * (@thadfiebich)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/code-to-get-template-name/)
 * I have a page template
 * /*
    Template Name: Front Page */
 * Is there a way in code I can create a conditional statement that will say
    if(
   template == “front page”) { do something… }

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

 *  [doc4](https://wordpress.org/support/users/doc4/)
 * (@doc4)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/code-to-get-template-name/#post-1588896)
 * thadfiebich,
 * Can you elaborate a little more on what you are wanting to do?
 *  Thread Starter [thadfiebich](https://wordpress.org/support/users/thadfiebich/)
 * (@thadfiebich)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/code-to-get-template-name/#post-1588904)
 * thanks! i am just going to use the custom menus… solves the issue.

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

The topic ‘Code to get template name’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [thadfiebich](https://wordpress.org/support/users/thadfiebich/)
 * Last activity: [15 years, 9 months ago](https://wordpress.org/support/topic/code-to-get-template-name/#post-1588904)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
