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
- How to edit contents of dynamic_sidebar()?
- 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?
- dynamic_sidebar not rendering sidebar
- bloginfo(‘stylesheet_directory’) vs. get_stylesheet_directory_uri() and include(‘file.php’) vs. get_template_part()
- Display comment form of specific page in sidebar
- Category specific months list in sidebar.php
- Add featured image to sidebar [closed]
- 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
- How to exclude parent category but show child categories?
- Specific and Different Ads for each Post?
- Template part vs Sidebar (differences)
- Backend menu sidebar collapsed by default every time? [duplicate]
- Get sidebars depending on page
- Unregister sidebar from Child-Theme
- How can I hide the sidebar on specific pages?
- How to delete wordpress menu
- 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
- 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 are Dynamic Sidebar Widgets rendered
- Output dynamic_sidebar into PHP
- Sidebar loop – Thematic Framework
- Dividing widgets in sidebar?
- How to add an entry to the Page/Post Settings Sidebar? [duplicate]
- How to get the sidebar HTML content?
- Adding Multiple Sidebars
- author list not linking to correct page
- sidebar parameters (before_widget, before_title) not Working
- Load sidebar template just once to prevent multiple animations
- Call dynamic sidebar by name not ID
- Sidebar widget not displaying after simple code update.
- Dynamic sidebar rendered in another place than i would like
- How to create a post template with two sidebars
- Common side bar for multiple websites
- How do I show breadcrumbs when sidebar is not applied?
- Load different single.php templates according to post layout selection
- Sidebar only shows up on blog page
- How do you control sidebars when there’s no get_sidebar in templates?
- Find sidebar.php in WP 3.9.2
- Sidebar not appearing on page template with custom posts
- get_posts() in secondary sidebar messes up content in primary sidebar
- Get specific sidebars $wp_registered_sidebars [closed]
- Twenty Thirteen get_sidebar Question
- Function to add class to element?
- Is it ok to chop index.php and include files?
- WordPress – Allow dynamic text to be added into a sidebar upon page creation
- How to remove the ‘Archives’ title and list and the ‘Meta’ title
- Custom /Page/2/ Template Only
- How do i replace the sidebar to use pages instead of blogs?
- Custom sidebars – get_sidebar() problems
- Sidebar Stuck To First Post, Not Top Of Page
- Is there a way to display content from a post meta box in the sidebar?
- Header image is overlapping sidebar?
- “Folding” links in the blogroll
- How to assign a sidebar to a WordPress page when none was there before
- Mobile Menu and Mobile Sidebar missing
- How to make sidebar float right and site content left
- The WP home page corrupted after switching to new theme
- Problem adding sidebar to Underscores theme
- unordered list loop not showing up in sidebar
- Single Sidebar; multiple templates! How?
- Change Sidebar for rewritten page
- Change page layout
- Main content showing up below sidebar
- I’m hit with: undefined constant register_sidebar. Once in debug mode? [closed]
- I’d like to add an fa icon before a link in my ‘recent post’ side bar [closed]
- Call Multiple Sidebars at once
- echo widget contents
- How to unregister sidebar for template_part?
- Include inside sidebar
- My side bar is missing from new pages.
- Change /add items in menu on the inner sidebar
- sidebar – widgets versus code – options
- Template is different with and without comments
- Only display on sidebar if only got value inserted on post
- How to display a sidebar only for blog?
- Single template will not show sidebar/bottom-nav and footer
- Sidebar not visible after changing to new domain
- How can I use Page editor for two separate templates?
- Resizing Picture
- Sidebar not displaying on custom-page.php
- Searchresult sidebar change
- Differentiate Between Parent & Child Categories
- Images in Woocommerce Product Sidebar [closed]
- Persistent sidebar.php [closed]
- Archive Widget – Show selected Category Post title. Sorted by Year
- Sidebar not appearing
- Woo commerce Single Product Sidebar [closed]
- how do I change the side bar content?
- Disappearing Widget Text area