You can use is_singular()
instead.
According to Codex, you can use this function the following way:
is_singular($post_type);
Then you can print your desired code into footer the following way:
function my_footer_code() {
if ( is_singular('my-post-type') ){
//Your code here
}
}
add_action('wp_footer','my_footer_code');
Related Posts:
- Opinions and recommendations on the best barebones base theme [closed]
- Customizing a WordPress theme without changing it?
- How to Link External jQuery/Javascript files with WordPress
- Custom Taxonomy-specific JavaScript
- Any official way to create an admin theme?
- Splitting an Evolving Site into Multiple Sites, or Maintaining as One Site?
- Building useful features into your theme
- Multisite: setting theme and options when a new blog is created
- Editing theme files and access to the Code pages only to super-admin?
- Change Default Image HTML
- How to delete default themes
- Extra User Profile Field Upload File / Image
- Edit raw HTML of the landing page
- Problem : deletion failed, the theme requested does not exist
- Theme Activation, Create Database Tables
- Will activating a different theme preserve custom settings to current theme?
- Can I apply a WP theme to a specific custom page template?
- How to trigger function on theme delete?
- Setting a static home page and blog page without using the settings
- Two Navigation Menus – secondary nav is including main nav
- Possible to put header-{your_custom_template}.php in subdirectory?
- Renaming the Twenty Fourteen WordPress theme
- Protect changes made to the theme when updating
- Theme Development Admin Area [closed]
- How to set a single theme directory on a multisite blog?
- Static page not working
- Custom options below pages/posts editor?
- Problem of running development copy of WordPress on WebMatrix?
- Different logo on homepage
- the_content() is not displaying content, why? [closed]
- What is the correct way to integrate wordpress with another php application?
- Customizing page content layout
- Tips for managing code when developing a parent theme framework
- Trying to uninstall a theme, but it’s hijacking my home page
- Most wp_nav_menu parameters ignored
- Using the same database on another Subdomain
- How to include stylesheet in custom admin using parent_slug
- Custom fields not displaying on front end
- My blog suddenly can’t find my stylesheet?
- Customizing 1 theme for multiple blogs in a multisite setup
- Is there any way to modify images from a theme using the web interface?
- Default and warning messages & no login
- dynamic image path within a javascript file
- Display ads by location [closed]
- WordPress Dashboard Problem [closed]
- Theme Dev | Convert Template to Theme
- Work on theme files on a server & browser preview before installing it
- Create a child Theme or custom Theme
- Theme Options Menu Item – Permission Issue
- Static front page displaying twice
- Static posts page is not working
- how to add version of style.css in wordpress
- What is the role and history of the $content_width global variable?
- Add a page outside of the current theme?
- How to create a live demo page for a theme? [closed]
- Is it possible to stop a theme activation when a certain plugin is not activated
- add image size still doesn’t work even after regenerating thumbnails
- Best location for theme translation files
- Single Page WordPress CSS and JS links
- How to develop a theme while having another show up
- When does WordPress wrap inline scripts in CDATA?
- Being asked to update a theme that I don’t have
- Switch to other theme at URL
- How to go about pre generating css file with variables from theme options
- How can I create an “excerpt” with text that won’t be displayed in the post itself?
- How to change sidebar per page?
- Animated gif for a thumbs
- Error defining a gutenberg block in a theme
- Page dissapears when i click save
- Can’t resize logo in responsive theme?
- Is wordpress big enough for my project [closed]
- Theme doesn’t support shortcodes
- Theme folder doesnt exist
- WordPress activate theme error $pagenow
- Increase content area width in TwentyFourteen [closed]
- Undefined variable error in theme option after updating theme [closed]
- Comments not displaying after changing theme
- Theme Translation?
- Two column layout in WordPress?
- List of categories instead of dropdown menu selector in admin options
- How can I show some standard html code across any theme I install?
- Losing theme customization when switching from a theme to a child
- How to prevent plugin, theme installation failures on WordPress?
- Problem of not changing the front and bottom of the Woodmart template by activating the really simple ssl pro plugin in WordPress
- Please help me clear my confusions about WordPress
- Allow WP users to sort search result on a videos site
- How can I theme or style the lost password page without a plugin?
- How to narrow the area between buttons on Helium theme sidebar? [closed]
- use a Thumbnail size in post
- Why does WordPress Editor Only Use Half the Box?
- Installing Theme from uploaded file. Not uploaded theme?
- WordPress Twenty-Fourteen: How to Remove Home Page Header Image from Other Pages
- WordPress theme not updating in Other browsers
- WP-CLI wp theme install url PCLZIP_ERR_BAD_FORMAT (-10) : Unable to find End of Central Dir Record signature
- Site broken after deleting inactive themes [closed]
- Can i add wordpress editor to my custom theme option? [closed]
- wp_nav_menu in 3.7 add name class nav navbar-nav
- Best way to include pagination in a theme [closed]
- What happens to bespoke page template references on theme change?
- How to change the standard width of a page