- <div class="container">
- <style>
- .debug {
- margin-left: 15px;
- padding-left: 15px;
- border-left: 3px solid #d7470f;
- }
- </style>
- <div class="template-tests debug">
- <?php
- echo '<h2>Static Vars</h2>';
- echo '<b>ID:</b> ' . get_the_ID() . '<br />';
- echo '<b>is_page_template():</b> ' . is_page_template() . '<br />';
- echo '<b>get_page_template:</b> ' . get_page_template() . '<br />';
- echo '<b>get_page_template_slug:</b> ' . get_page_template_slug() . '<br />';
- echo '<br />';
- if (is_page_template()) {
- echo '<h2>Yes, I am a page template</h2>';
- if (is_page_template('templates/debug.tpl.php')) {
- echo 'I am the <i>debug.tpl.php</i> <br />';
- } else {
- echo 'I am not the <i>debug.tpl.php</i> <br />';
- }
- } else {
- echo '<h2>No, I am not a page template</h2>';
- }
- ?>
- </div>
Recent Pastes