Posts Categorized:
php

How To: Add Inline Scripts and Conditionally Enqueue Scripts & Styles in WordPress

Sometimes when making a theme or plugin, you want to conditionally enqueue a script or style so that it does not load on pages where it is not used. This process is generally pretty straight forward, just add your enqueue functions inside of conditional statements like this: add_action(‘wp_enqueue_scripts’, ‘add_script_function’); function add_script_function() {   if(condition one… Read more »

How To: Change a Hex Color With PHP

I was recently working on developing a WordPress theme, which uses the customizer to change colors throughout the theme. Adjusting styles is pretty straight forward with Javascript or jQuery. You can add a script to overwrite the CSS style. Unfortunately in some cases, it is either not possible or practical to use JavaScript to change… Read more »