Getting dynamic data into JavaScript using Ajax

So there are often times you would like to have settings in the WordPress dashboard but use the data in a js file. I found that this can easily be done using a jQuery.post call to a WordPress Ajax url. /* Javascript file */ var site_url = ”; jQuery( document...

Disabling a CheckBox until a Textarea is scrolled to end

So there are sometimes occasions where I need to have a person who is on a form scroll to the end of a checkbox to try to make sure they have read it. Scrolling to end just means they acknolwdge this even if they don’t read it so I created the following jQuery....

Enqueue Styles and Scripts in Functions File for Child Theme

This is what you need to include in the functions file of your child theme to include the parents style without having to do a @import in the css file. This also checks the last modified time and uses that as a query variable to ensure you are loading the latest...

Enqueuing jQuery for WordPress Theme

Here is the function to add jQuery to the front end of the site. ¬†You just need to enqueue the script labeled jquery. if (!is_admin()) add_action(“wp_enqueue_scripts”, “default_jquery_enqueue”, 11); function default_jquery_enqueue() {...

Google Tracking Telephone Clicks w/ WordPress integration

So if you have jQuery and the gtag method for Google Analytics running on your site you can add the following code to the head tag of your site. jQuery( document ).ready( function() { jQuery(“a[href^=’tel’]”).on(“click”,function(){...