Posts Categorized:
Blog Posts

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 »