You should really learn how to use debug mode in WordPress. You should go and read this page: Debugging WordPress. The reason being is this line of code
add_action( 'wp_footer', 'print__my_inline_script' );
If you had debug enabled, you would have seen a message like this
Warning: call_user_func_array() expects parameter 1 to be a valid callback,
because your function name is print_my_inline_script()
and you are hooking print__my_inline_script
to wp_footer
Also, you should not use capital letters in template names, never.
You can extend the pages you want to load your script/style on by just adding || is_page_template('template name' )
to your existing conditions. You should also have a look at conditional tags and the is_page()
condition
Related Posts:
- Define page template in wp_insert_post
- Add custom template page programmatically
- Define custom Page Template without its own .php file
- Filter the query ONLY for the search results page
- AJAX handler throws 400 (Bad request) – why?
- ajax live search for post title
- Apply jquery script to only woocommerce product pages and categories
- Replacing select2 in admin backend for all selects
- How to save Uploaded image in custom option panel?
- Custom page template how to check is_page from functions.php?
- Run Product Filter Javascript On Page Template
- jQuery plugin function is not a function
- Display a function using AJAX
- Enqueuing Script in functions.php vs on the page
- Programmatically set page template based on page ID
- How to make unique add_filter to the_content of specific page template files – so each template gets its own addition
- Unable to get_the_content(); of a post in WordPress via AJAX
- Adjust which tempalte a page uses with a function?
- Add external js file to footer with id
- Ajaxing function in widget class
- How to load some jquery code to make validation in the theme customizer?
- How to specify which Gutenberg blocks are available in the editor for a page template
- woocommerce target button with class after ajax update
- Move jQuery and Migrate to footer?
- how to change link of some wordpress pages
- jquery won’t load in footer
- Filtering posts by category name based on page’s slug
- WordPress doesn’t Load JQuery Now? Do I need to enqueue JQuery also?
- Woocommerce checkout field maxlength, make input number field only (postcode)
- is_account_page() change to page slug
- Replace menu links with # and add name to its li
- How to enable template page only for a post id page
- Loading CDN that requires jQuery in WordPress
- Activate small php condition at footer over page template
- is_customize_preview() like function to check if Customizer “Live Preview” in JavaScript
- Right way to update widget on dynamic new input field
- How to load jQuery in the footer – nothing works for me
- Not sure if enqueuing js scripts properly
- Get_template_part inside a folder
- Wp_query function to search from product_title ‘OR’ product tags name
- Allow Post Author to be 0 on Update
- Auto scroll to id on page load on all pages except home page. Only do this on mobile
- How to load jQuery in TOP of wp_footer?
- Passing Jquery value to WordPress function
- WordPress can’t get jquery/unslider to work
- Add loggedout class on body using a function or JS
- Are innerHTML elements visible to jQuery functions?
- Include Jquery libraries in wordpress theme?
- Page Template Won’t Load Correct CSS File
- Why a SlideShow (made using JQuery FlexSlider) can’t work if I load it form functions.php but work if I load it from my footer.php file? [closed]
- get content from page through AJAX
- Creating multiple category drop down
- How to setup a popup registeration page in wordpress with function.php
- colorbox not loading in
- How to add php within jquery
- Function to check if custom page is used by page?
- Help with IF has focus then… statment
- Unable to use get_page_by_title() more than once per page?
- Get URLs for AJAX Filter Checkboxes WordPress
- wp_set_object_term via js btn frontend
- Populate Product Regular Price with a calculated ACF Field Value
- Hide ‘add to cart’ when certain value in dropdown is selected
- Ajax Form Issues using Lightsail (AWS)
- How to Override Page Template if URL matches query?
- Probleme shortcode with list author
- What is the earliest Hook a Script can use?
- WordPress does not load jQuery
- How Can I Create a Friendly Slug for a Dynamic Page?
- post value to function with Ajax and jQuery
- Enqueue script if not page template
- Images with overlay
- How to use `foreach()` in ajax call
- How To Display Author Popup on Entry Meta (Genesis Framework)?
- Multiple Notifications SetInterval
- How do i create a search option for pdf’s only
- WordPress Ajaxifying not working properly
- Execute jQuery with custom event listener after successfully add an item to the cart
- Pagination won’t work on custom page
- Load scripts into an AJAX div
- Load scripts into an AJAX div
- Edit meta fields from within template
- True parameter but jquery register in header and not in the footer with wp_register_script
- Sending Messages Back to the Template After Processing?
- Automatic add space if user enters number(any digit)
- WordPress Jquery+scripts enqueue issue
- Moving CDN jQuery to footer does not work?
- is_page_template wont allow me to enqueue scripts
- Adding a jQuery rotator function
- Why are some custom javascript files working but some are not
- WordPress Javascript Widget jQuery Dependency Issue
- jQuery HoverIntent is not a function
- Ajax call does not work for this custom code
- How do I get my nav menu to show sub pages?
- Having problems loading Jquery in functions.php
- Owl Carousel and WordPress Integration Via WP_Enqueue
- AJAX values converted to PHP Variables?
- Animated Accordion [closed]
- Logout redirect via page template without confirmation?
- Template Redirect Function Only Working When Logged In
- iOS and ajaxComplete