by greg | Feb 26, 2021
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...
by greg | Aug 14, 2020
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. I...
by greg | Jun 21, 2016
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...
by greg | Dec 9, 2016
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() {...
by greg | Nov 26, 2019
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(){ gtag(...