Category Archives: Code
Converting PHP to JSONP with json_encode
PHP has a nice function called json_encode that will transform a PHP array into a JSON object. This is very useful for converting data and publishing it for use with AJAX requests. When you want your data to be accessible … Continue reading
Using wp_enqueue_script and wp_enqueue_style with your WordPress Theme header
For the longest time I was including my Javascript files in WordPress with a simple Javascript statement in the header.php file. I’d reference the theme directory like this to make it portable. <script type=”text/javascript” src=”<?php bloginfo(‘stylesheet_directory’); ?>/js/jquery.js”></script> <script type=”text/javascript” src=”<?php … Continue reading