is_page_template( string|array $template = '' )

Whether currently in a page template.

25 related functions found for: is_page_template

Top ↑

Related terms found for this post

wp-parser-related-wordsexist, is, page, post-template-php, post-typ, post-type, templat, template, wp-includes
wp-parser-packageTemplate, WordPress

Top ↑

Terms Used Terms Used

Terms used in the related posts query

  • exist
  • is
  • page
  • post-template-php
  • post-typ
  • post-type
  • templat
  • template
  • Template
  • wp-includes
  • wp-includes/post-template.php

Top ↑

Description Description

This template tag allows you to determine if you are in a page template. You can optionally provide a template name or array of template names and then the check will be specific to that template.

Top ↑

Parameters Parameters


(string|array) (Optional) The specific template name or array of templates to match.

Default value: ''

Top ↑

Return Return

(bool) True on success, false on failure.

Top ↑

Source Source

File: wp-includes/post-template.php


Top ↑

Changelog Changelog

Version Description
4.7.0 Now works with any post type, not just pages.
4.2.0 The $template parameter was changed to also accept an array of page templates.
2.5.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.