One thing that I found difficult to understand when starting out with WordPress development was how to use PHP variables in my JavaScript. I’m not sure why I found it so confusing. There are a lot of good examples out there but I thought I would break down how use PHP variables in your JavaScript… Continue reading Passing PHP Variables to JavaScript in WordPress
Category: Javascript
Inserting JavaScript with a Shortcode
Have you ever needed to insert a piece of JavaScript into a single post or page? Maybe there is an external contact form from a vendor that you’ve been given a snippet of JavaScript to include? There are a number of ways to do this. You could put a conditional in your template file and… Continue reading Inserting JavaScript with a Shortcode
Passing PHP variables to JavaScript
I was recently working on a project in CodeIgniter and I was setting numeric variables with constants for things like locations (1 = Maine, 2 = New Hampshire, etc.). This all worked fine but when it came to doing some JavaScript AJAX work I didn’t have access to these constants. One of the advantages to… Continue reading Passing PHP variables to JavaScript
Debugging Google Analytics
I was recently working with Google Analytics and discovered the Google Analytics Tracking Code Debugger. In the past, one of the biggest frustrations I had was that I would make a change and then have to wait until the next day to see if the changes worked. I guess that the time to see results… Continue reading Debugging Google Analytics