JQuery and Javascript to pan image

I had to overcome two issues to resolve this. The 404 error was due to the way I registered the script. It pointed to the parent theme folder, while I had saved the .js file to the child theme folder. For the moment, I’ve put a copy in the parent theme folder, and am looking … Read more

WP Media Uploader modal conflicts with Bootstrap modal

Just proxy the modal-open class for Bootstrap like this: .bs-modal-open { overflow: hidden; } .bs-modal-open .modal { overflow-x: hidden; overflow-y: auto; } // or using sass … .bs-modal-open { @extend .modal-open; } Add/remove the bs-modal-open class to the body when opening/closing a BS modal: $(‘.bs-modal’) .on(‘show.bs.modal’, function (e) { $(‘body’).addClass(‘bs-modal-open’); }) .on(‘hidden.bs.modal’, function (e) { … Read more

comment-reply.js disables any other form javascript

I found the cuplrit and has nothing to do with comment-reply.js. I was targeting my javascript based on which template and of course the javascript wasn’t loading. if( $(“body”).hasClass(“page”) ){ … Needed to add this: if( $(“body”).hasClass(“page”) || $(“body”).hasClass(“single”) ){ …

Why I’m Not Having Access to “$_POST” Data Outside My AJAX Callback?

Maybe It’s the Appropriate Answer for You! Accordingly to this question the more reasonable answer is to use wp_send_json() with (if only necessary) the wp_send_json_success() and wp_send_json_error() functions. They’ll return an JSON Object back to the AJAX Request and it will automatically die() for you. It will look something like this: add_action( ‘wp_ajax_origin’, ‘create_an_ajax_request_origin_form’ ); … Read more

Add HTML between feed items

you can add some code to the bottom of each feed post, this would give you the desired result. You can add this code to your functions.php or add it as a plugin /** Add custom feed content footer * @param $content * @return string */ function add_feed_content($content) { if(is_feed()) { $post_type = get_post_type( get_the_ID() … Read more

Jquery not loading / running on WordPress home page

You have initialized the script twice. Here is the updated script: jQuery(document).ready(function($) { var $window = $(window), win_height_padded = $window.height() * 1.1, isTouch = Modernizr.touch; if (isTouch) { $(‘.revealOnScroll’).addClass(‘.animated’); } $window.on(‘scroll’, revealOnScroll); function revealOnScroll() { var scrolled = $window.scrollTop(), win_height_padded = $window.height() * 1.1; // Showed… $(“.revealOnScroll:not(.animated)”).each(function () { var $this = $(this), offsetTop = … Read more

Jquery code won’t run loaded from WP, but run from console

Ok, the code is fine, the problem is that the target button[data-id=”select-especialidad”] is being used by bootstrap-select and even if the script load before my code, it takes a few seconds or less to process the information. So the code should be wrapped after a function that checks that the event has been loaded. This … Read more

Form not working as it should in WordPress, but in a normal HTML site it does

So I finally found the solution to the problem. It was in the validate.js function. I corrected the error by calling the outside functions of validate.js and jquerry: script type=”text/javascript” src=”http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.4.4.min.js” script type=”text/javascript” src=”http://ajax.aspnetcdn.com/ajax/jquery.validate/1.7/jquery.validate.min.js”

I can’t enqueue Suggest.js in frontend – not added

Provided you’ve confirmed that WP’s native ‘suggest’ script is actually being rendered on the page properly (ie. you’re using the correct template for home vs front-page), sometimes to avoid script conflicts on the page, you need to wrap your script in an anonymous function. So something like: <script> (function($) { $(“#my_input”).suggest(“<?php echo get_bloginfo(‘wpurl’); ?>/wp-admin/admin-ajax.php?action=ajax-tag-search&tax=my_taxonomy”, { … Read more