is_page_template()
checks against post type templates specified by the theme using
/**
* Template Name: My Template
*/
at the top of the template file. Not any arbitrary template file. For this, you might wanna check out the answers over at Get name of the current template file. You could grab the code from the accepted answer there (get_current_template()
) to do something when single.php === get_current_template()
.
Related Posts:
- Why use if function_exists?
- get php variable from functions php and echo it in theme template files [closed]
- Use AJAX in shortcode
- Include files in child theme functions file
- WordPress function like is_category for subcategory? is_subcategory?
- WordPress Theme Update Action?
- How to get woocommerce inventory status [closed]
- Using a private method as an action callback from within a class
- Auto close (hide) custom metabox / set default state
- Does WordPress Development Mode Exist (with not minified JS)?
- WP_Query in functions.php
- Implementing DNS Prefetching with WordPress
- wp_delete_user with username
- what is the meaning of settings_fields()
- Organize functions.php
- Why do I get Fatal error: Call to undefined function get_most_recent_post_of_user()?
- How to activate “Description” metabox for menu item programmatically?
- Change labels on ‘Nickname’ and ‘Biographical Info’ in user-edit.php
- Edit the_content function
- write in functions.php
- How to set child post categories to parent post categories when updating parent post?
- get excerpt without images
- display 100 products per page on product category page [closed]
- Advice: Template structure – php blocks in sidebar or someting else?
- Help to resolve Syntax error, unexpected ‘endwhile’ (T_ENDWHILE) [closed]
- Checked() showing up twice in custom fields
- Removing the first image in content
- Make menu structure match page heirarchy on page parent change
- Gravity Forms field entries into wp_query loop [closed]
- Global functions on WPMU
- Remove the deleted users avatar from list
- is_account_page() change to page slug
- Adding to fontawesome-webfont.woff2 to boost website speed
- How to enable template page only for a post id page
- Help with WP gallery function, wrap gallery in div
- set_post_thumbnail when user is not logged in
- Can you put a condition on add_image_size() depending on the width of the uploaded image?
- Force to use STRONG users password and implement rule to prevent REUSE [closed]
- Overwriting the menu break points of twentysixteen in child theme
- Is there a WP function to get taxonomy name from taxonomy_term_id?
- Passing User_Fields to Contact form 7 [duplicate]
- How can this crude function be improved?
- Help With Creating Shortcode
- How to override woocommerce.css?
- Author Date Function not working as expected [duplicate]
- Add_filter when value is no variable?
- The Loop not looping?
- wp_star_rating() – Adding a 5 star rating system to theme
- How to hide image-url if no attachment?
- Use Composer Package inside class – Namespacing error
- How to properly refresh page after form action?
- Default Nav Highlight
- Update to functions.php not showing in dashboard
- Change WooCommerce add_to_cart Button Text?
- WordPress Website with Login system
- Return link pages instead of displaying them
- Adding Read More to Custom excerpts
- wp_get_attachment_image_src returns image on main domain, false on subdomain
- Add a custom function to widget code
- Create Custom URL structure for specific Post category using Post ID instead of post name
- Add custom taxonomy using JS in post editor
- WordPress: Highlight search result exact matches
- Exclude specific post from query
- wp_set_object_term via js btn frontend
- How can I show a specific page to admins only?
- Hide author info in single posts by certain users
- Creating a custom functions page wordpress
- search and replace using regex
- post value to function with Ajax and jQuery
- (Divi): How to make WordPress load images of specific size for Blurb modules on given page with a funciton?
- Strip all HTML tags from product content and resave
- Calling hooks in functions
- WordPress Toggle Menu has stopped working
- How do I dequeue a Stylesheet, stored in an ‘Assets’ folder?
- Shortcode with pagination advancing multiple queries
- Author Page User id in functions.php for non login user
- How to add widget in main menu
- Restrict certain roles registrations by domain
- Replacing term/taxonomy archive pages with search queries
- Return ACF Field value function
- Best way to add image to recent posts widget?
- wp_enqueue_script only works outside of action
- How can I include user meta information in the resulting array of a WP_User_Query?
- How to add next height number in Order Attributes inside the Add new page. [duplicate]
- Force changing the Site Title and add link
- create submenu page – error function not found or invalid function name
- Get Value of Custom Field
- How does child theme functions.php work with parent theme functions.php? Is it like CSS? [duplicate]
- Undefined offset: 2
- Need a functions that adds (adm)/(mod) if current user is admin/moderator right after their username
- Using is_plugin_active within functions.php
- Add title & subtitle to shortcodes
- Button generate a random URL [closed]
- How to Delete Posts by title?
- How do I add functionality to images?
- Display function from functions.php in tag.php
- AJAX values converted to PHP Variables?
- Custom Post Type Search
- Change Post status based on custom field date +1 day
- How to add height and width dimensions automatically to archive descriptions