jQuery to work on WP custom page template

Probably there are a lot of questions/answers here in wpse that explain this kind of issues and the use of jquery and other js in wordpress. However, In wordpress never put javascripts in template files. Javascript should be in separate .js files. The javascript should be putted in the templates using wp_register_script / wp_enqueue_script functions … Read more

Custom jQuery plugin not working

First, your link 403’s for me. I assume you’re using the code I found here: https://github.com/trentrichardson/jQuery-Timepicker-Addon/blob/master/dist/jquery-ui-timepicker-addon.js Now, the $ thing is not a problem, that JS code library uses a proper $ wrapper, so it will work fine without modification. The actual problem is a simple misspelling. Look at this line of code: wp_enqueue_script(‘timepicker’, get_stylesheet_directory_uri() … Read more

Using jQuery to override the content of a div [closed]

In some instances, I’ll run a delayed init function in a setTimeout like this: var delay = setTimeout(function() { jQuery(“p.help-block.small”).html(“<p> … </p>”); }, 100); In the event that something is overwriting the html of that paragraph block on page load, this function will run 100 milliseconds after that, making yours the last change to the … Read more

Change image on post title hover (more than one instance) – Jquery

I think you could the code working, if you used the current term as the selector as there’s only one featured image and multiple links for each term. For example, first add the term to the image classes, <img class=”img-fluid ga-img ga-img-<?php echo $term->slug; ?>” src=”https://wordpress.stackexchange.com/questions/366314/<?php echo esc_url($ga_url);?>”> Then add the term to every post … Read more

Stylesheet won’t load even when linked

Add the CSS to your child themes style.css file or load it using wp_enqueue_scripts add_action( ‘wp_enqueue_scripts’, ‘wpsites_load_custom_styles’ ); function wpsites_load_custom_styles() { wp_register_style( ‘custom-css’, get_stylesheet_directory_uri() . ‘/your-style.css’, false, ‘1.0.0’ ); wp_enqueue_style( ‘custom-css’ ); } Source

ajax form function error

This error is telling you that there was a 500 error in the PHP of your AJAX callback: jquery.js:8625 POST /admin-ajax.php 500 () This would be caused by a syntax error or other coding mistake. In looking at your code one obvious major problem is here: // use \Aws\Polly\PollyClient; // this was moved to before … Read more