Simplify your code for a test
if (is_page_template('news-page.php')) { ?>
<p>yes!</p>
<?php } else { ?>
<p>not 'news-page.php'</p>
<?php }
Related Posts:
- How to have dynamic sidebar content per post
- Get list of all registered sidebars
- What is the difference with get_sidebar and dynamic_sidebar?
- How to edit contents of dynamic_sidebar()?
- how do I get_sidebar into a varaible?
- Best way of making multiple sidebars
- Hooking a function onto the sidebar?
- Show Woocommerce minicart widget in checkout page sidebar? And, how to make this update secure by overriding widget?
- Changing name of sidebar widget
- Different widgets on different page templates?
- Getting post-thumbnails from another WP site
- dynamic_sidebar not rendering sidebar
- Get custom side bar on custom post archive page
- bloginfo(‘stylesheet_directory’) vs. get_stylesheet_directory_uri() and include(‘file.php’) vs. get_template_part()
- How do I hook a sidebar via add_action?
- Display comment form of specific page in sidebar
- Category specific months list in sidebar.php
- Add featured image to sidebar [closed]
- Best approach for loading a sidebar Only if the screen max-width is >900px?
- Is there possibility to Customize the present theme adding sidebars
- Get a sidebar at the top of the page
- Custom sidebar not showing in the dashboard
- Sidebar random author spotlight
- Can not Remove Archives and Meta from Sidebar
- Sidebar Generator? :)
- Main Sidebar Dispappeared – What could possibly cause this?
- Change which sidebar get_sidebar() gets from functions.php
- How to exclude parent category but show child categories?
- Specific and Different Ads for each Post?
- Why and how is twentythirteen adding a margin-top to my footer?
- Adding content to sidebars
- Twenty Ten child theme has post on an inner page. Cant get that page to use my desired template
- Template part vs Sidebar (differences)
- Change directory where get_header(), get_footer() and get_sidebar() look for templates
- Change sidebar headers from H1?
- Load same sidebar multiple times
- How to replace WordPress sidebars (widget areas) with Gutenberg
- Backend menu sidebar collapsed by default every time? [duplicate]
- How to check if searchform.php is being included as widget?
- Make “sidebar template” the default template for new pages
- Get sidebars depending on page
- change sidebar or just widgets for 2 specific post type single posts
- Unregister sidebar from Child-Theme
- How can I hide the sidebar on specific pages?
- How to delete wordpress menu
- Toggle Sidebar Display
- Display sidebar if blog
- How can you add a link to a sidebar description?
- unregister_sidebar() in stand-alone theme not working
- CSS Twentyeleven / Sidebar has to be changed IN the CSS Stylesheet. Sidebar on the left side
- Display a specific dynamic sidebar widgets on a specific page
- Inject PHP code into “sidebar-content” – code before my WooCommerce sidebar widget?
- Why does the TwentyTen Theme sidebar have a class called ‘xoxo’?
- Dynamic Sidebar for subcategory of a category
- Same date is repeating on my custom ‘Most Recent Posts’ on sidebar
- How to add Sidebar and Full width option in post editor
- Corrupt WordPress Design/Appearance [duplicate]
- How are Dynamic Sidebar Widgets rendered
- how to exclude posts on current page from recent posts sidebar widget
- How to add a class when there’s no sidebar?
- Output dynamic_sidebar into PHP
- Creating a different side bar for single posts than for main page.
- Sidebar loop – Thematic Framework
- WP for main site and two blogs – implementation
- How to list custom post types in a secondary sidebar?
- From what hook on is it possible to conditionally add actions?
- Dividing widgets in sidebar?
- Post thumbnails in sidebar & footer?
- Paging in a sidebar mini loop
- How to add an entry to the Page/Post Settings Sidebar? [duplicate]
- Sidebar on the wrong side of the page
- Include a sidebar on the static front page of twenty thirteen
- How to get the sidebar HTML content?
- Adding Multiple Sidebars
- How to increase maximum number of sidebars support?
- author list not linking to correct page
- sidebar parameters (before_widget, before_title) not Working
- Unable to call specific dynamic_sidebar
- Display smilies in Sidebar, too?
- How to enable the default sidebar area?
- Remove Sidebar from WordPress [closed]
- Load sidebar template just once to prevent multiple animations
- Call dynamic sidebar by name not ID
- Sidebar widget not displaying after simple code update.
- How to send data to sidebar?
- Best practice for including plugin output in a template without using shortcode?
- Dynamic sidebar rendered in another place than i would like
- How to create a post template with two sidebars
- Gutenberg sidebar example does not update meta field in the database
- Implementing Sticky Kit on WordPress
- Check if sidebar is rendered?
- Not Getting Sidebar
- Where is dynamic_sidebar content defined?
- Why does my sidebar get dragged down on this specific uid?
- Common side bar for multiple websites
- Dynamic Sidebar Conditional [duplicate]
- Cannot retrieve author in sidebar of single.php
- finding sidebar content in wordpress
- Extra copy of sidebar appears in footer
- get_sidebar() will not work in footer.php