using jQuery on only one page

You don’t need to add it on a template, you can use the wp_add_inline_script() function. It’d be something like: function tabs_enqueue() { if(is_page( 205 )) { wp_enqueue_script( ‘ui’, get_template_directory_uri() . ‘/js/ui/jquery-ui.min.js’, [], ‘1.8’, true); wp_add_inline_script( ‘ui’, ‘jQuery(window).load(function() { //code here });’ ); } } add_action(‘wp_enqueue_scripts’, ‘tabs_enqueue’); Hope it helps!

Why does re-using this function not work? [closed]

Function “works” once because before first call of is_service_class(), function is_personal not exists and whole this block is executed if ( ! function_exists( ‘is_personal’ ) ) { // declaration and use of function } In next call of is_service_class() is_personal is declared and the entire block is skipped. Inside the condition if ( !function_exists( ‘is_personal’ … Read more

Inject class in body when particular page template is used

there is a filter for that and it’s called… body_class 😉 This should work for your case: function add_my_custom_body_class( $classes ) { if ( is_page_template( ‘page-customer.php’ ) ) { $classes[] = ‘body_customer’; } return $classes; } add_filter( ‘body_class’, ‘add_my_custom_body_class’, 10, 1 ); if you wanna add class based on page ID (as you’ve mentioned in … Read more

Copyright info change – Corporate Plus Theme PHP [closed]

Both functions check if the function corporate_plus_footer() exists. If not, one is defined. Without going deeper into hooks and filters, you can simply declare your own corporate_plus_footer() and the other won’t get loaded. Add this to your functions.php function corporate_plus_footer() { echo ‘it works’; } No additional add_action() or similar. Just this function in your … Read more