is_page_template [ WordPress Function ]
is_page_template ( $template = '' )
| Parameters: |
|
| Uses: |
|
| Returns: |
|
| Defined at: |
|
Soorgelijke functies: get_page_template, get_paged_template, get_page_templates, get_template, get_page_template_slug
Whether currently in a page template.
This template tag allows you to determine if you are in a page template. You can optionally provide a template name and then the check will be specific to that template.
Source
<?php
function is_page_template( $template = '' ) {
if ( ! is_page() )
return false;
$page_template = get_page_template_slug( get_queried_object_id() );
if ( empty( $template ) )
return (bool) $page_template;
if ( $template == $page_template )
return true;
if ( 'default' == $template && ! $page_template )
return true;
return false;
}
?>
Examples [ wp-snippets.com ]
Top Google zoekresultaten
- Function Reference/is page template « WordPress Codex
Description. This Conditional Tag allows you to determine if you are in any page template. Optionally checks if a specific Page Template is being used in a Page.
codex.wordpress.org - Conditional Tags « WordPress Codex
is_page_template(): Is a Page Template being used? is_page_template( 'about. php' ): Is Page Template 'about' being used? Note that unlike with other ...
codex.wordpress.org - WordPress › Support » is_page_template refuses to acknowledge ...
if (is_page_template('page.php')) never returns true for me, whether a page is using page.php or not. Systematic research gives the following situations: ...
wordpress.org - How do I target a SPECIFIC template with is_page_template() in ...
I'm running Wordpress 3.2 and I need a conditional to test for a certain ... It's worth double checking which file is being used according to the ...
stackoverflow.com
Gebruikersdiscussies [ wordpress.org ]
- itsbarry on "is_page_template doesn't work for custom post type templates"
- Bill Zinclemyer on "is_page_template refuses to acknowledge the default page template"
- alanft on "[Plugin: Widget Logic] Is is_page_template() tag supported?"
- JochenT on "[Plugin: Widget Logic] Is is_page_template() tag supported?"
- dashaluna on "[Plugin: Widget Logic] Is is_page_template() tag supported?"
- fireproofsocks on "is_page_template doesn't work for custom post type templates"
- kuhio61 on "is_page_template doesn't work for custom post type templates"
- Rev. Voodoo on "is_page_template refuses to acknowledge the default page template"
- Jon Jennings on "is_page_template refuses to acknowledge the default page template"
- Jon Jennings on "is_page_template refuses to acknowledge the default page template"