You can also check if you are on page template with is_page_template function:
if(is_page(array(18,52,22,20)) || is_page_template( 'blog.php' )) {
//do your stuff
}
Related Posts:
- Functions For Calling Specific Elements
- My website is generating weired url parameters of paginated pages
- Get the ID of the page a menu item links to?
- How to redirect to post if search results only returns one post
- How to override admin-bar style
- Disable visual editor on one specific page
- How can I programmatically create “child” pages on theme activation?
- wp_get_attachment_image returns different image size
- Passing variables to templates (alternatives to globalizing variables)
- Load post with a different template?
- Slugs as breadcrumbs for Pages
- Check if has any sidebar active on current page
- How to fix a theme with page.php Default Template that accidentally deleted?
- Remove Page Title from Static Frontpage
- WordPress Change Post Templates,but not drop down, but Image selection
- Target a certain page within wordpress backend (admin) i.e. Pages > About
- Breadcrumb how i can display page title with parent > child title with permalink ? any Idea
- Using locate-template & shortcodes doesn’t appear to work
- Can I use require() function in a template file?
- How to set global variables in template page?
- Why isn’t is_page_template() adding a body class?
- Enqueuing Script in functions.php vs on the page
- Dequeue script in template isn’t working
- Programmatically set page template based on page ID
- Query children and parent title
- Help to resolve Syntax error, unexpected ‘endwhile’ (T_ENDWHILE) [closed]
- Adjust which tempalte a page uses with a function?
- How to change menu icon which is overriden (i.e. by WooCommerce) [closed]
- Delete pages and Create default pages for all new network sites
- Make “sidebar template” the default template for new pages
- how to change link of some wordpress pages
- Make menu structure match page heirarchy on page parent change
- Change the slug of a particular page every x hours
- Attach parent category template to all subcategories
- Add class or ID to any WordPress function
- How to remove howdy dropdown menu content
- Batch update menu_order attribute alphabetically
- How to create function from code?
- Display Password Protected external RSS in wordpress template
- is_account_page() change to page slug
- How to enable template page only for a post id page
- Selective Product Category for Carousel
- How to change login labels
- Modify a function without editing template
- Retrieve tags data in post body
- Don’t delete a page if it holds users
- List all-childpages on parent-page AND list child-pages on childpage itself but not the current one?
- Display post shortcode content in the sidebar?
- Why is my page feed returning empty content?
- Function only on a specific page
- Full page template function
- Get page id or status by private pages?
- Use WordPress function in php file
- wordpress use single ajax in place of multiple ajax requests in a smarter way
- Add Element as a Filter to the_content
- What is the text that appears beside the page titles in the list of pages in the WP admin?
- I have problems with loading javascripts
- Pass variable from action back to template
- Need print logo without any ID & class
- Define PHP variable from a seperate API if statement
- Enqueue script on every page except one
- Best way to handle lack of titles in microblogging
- attachment page template? only show attachments for current post?
- Run a jquery script on on a certain template page
- How to include any template using Shortcode fuction?
- Add a field into a shortcode of an extension
- Specify multiple categories for custom post template – FATAL ERROR
- Using functions.php to include code that’s processed inline
- How to make a new function that includes a template
- How to store a number (coming from cookie) into query vars for later usage in other filters?
- How do I register a new settings page? [closed]
- Only echo Page Content (not page title & page content together)
- get content from page through AJAX
- Show admin page, only if function is being used
- Overwriting TwentyTwelve template file with child theme template, but lower in the hierarchy
- Prevent creating multiple image resizes in twentytwelve template
- Simplest Way to Build Custom Archives Page?
- Display ACF category image on archive and single template files
- How to assign php file(template) to several pages with same prefix page name/slug
- Render page with specific id from functions.php
- How to require a config file in a template and in function.php?
- the_date() and the_time() functions display actual date an time instead of published date and time
- Load templates, pass arguments, and render output from functions.php
- Changing the HTML of notices in WooCommerce [closed]
- WP Enqueue Script Error
- Remove the delete link from pages without a plugin
- More than one search results page template for two searches on site
- WordPress function with attribute pass to template
- Change is_front_page() to is_page() to display ‘hero’ on entire site?
- Javascript and Stylesheet in child page
- Newest comments first not working
- How to pass a variable from a template page to the child theme functions.php
- Define an extra field for all pages (with no plugin?)
- Shortcode to output get_header not working
- Using array page name together with page id to deregister script
- How to add a class name to the ancestor of a post?
- How to add an excerpt and read more link to a page?
- Which template file to edit to edit homepage in Mystile [closed]
- Creating mixture of shortcodes to use in the visual/text editor
- How to store page-{id}.php templates in custom folder