WordPress does not load jQuery

I forgot to add a default case to the switch…case statement of my add_script_attributes function in the functions.php file. Sorry that I did not see this before. From my functions.php: function add_script_attributes($tag, $handle) { switch($handle) { case “Popper”: return str_replace(“src=”https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js””, “src=”https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js” integrity=’sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo’ crossorigin=’anonymous'”, $tag); case “Bootstrap”: return str_replace(“src=”https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js””, “src=”https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js” integrity=’sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI’ crossorigin=’anonymous'”, $tag); default: return $tag; … Read more

Bootstrap slider not working

You’ve tagged your question correctly with wp_enqueue_script but it doesn’t appear in your code so you are probably missing the jQuery library and bootstrap by the looks of it. Try adding the following: add_action(‘wp_enqueue_scripts’, ‘wp_add_jquery’); function wp_add_jquery () { wp_register_script( ‘my_jquery’, ‘http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js’); // Add your other scripts here (bootstrap, etc.) }

Opening Modal popup on Ajax form submission

It is not right location.href = “#modal”; when you need to change hash you need to use window.location.hash=”modal” but you have another problem! You need to initialize your plugin and use its api Instead of this location.href = “#modal”; you need to use: var inst = jQuery(‘[data-remodal-id=modal]’).remodal(); inst.open()

Outputting post content to jQuery .html() string

Well, just figured it out by using different search terms: https://stackoverflow.com/questions/10757671/how-to-remove-line-breaks-no-characters-from-the-string To remove HTML breaks from PHP returns (not actually called “line breaks” because they may get confused with the br tag) you’d have to use something like str_replace() with the \r and \n characters which are PHP breaks. In my case, this is what … Read more

jQuery Ajax not loading page with ACF fields

You are making direct calls to a PHP file in your theme, this is why you have the problem. Because WordPress didn’t handle the request, your file did, none of WordPress is loaded, and none of the plugins. There are also lots of security issues with this approach. If you need to make an AJAX … Read more