Conditional enqueues
-
Hello there π
I have a question regarding conditional enqueues, and whether or not Autoptimize honors them?
I am trying to reduce my page-weight on every single template in my theme, and I am trying to do this, by using conditional enqueues like so:
function my_enqueue_stuff() { if ( is_page( 'landing-page-template' ) ) { /** Call landing-page-template-one enqueue */ } else { /** Call regular enqueue */ } } add_action( 'wp_enqueue_scripts', 'my_enqueue_stuff' );Does Autoptimize recognize a pattern like this (Iβm guessing every template would serve a new bundle) – or is there perhaps another way to achieve this with your plugin?
Thanks for a great plugin by the way, I have benefited from it on many projects!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Conditional enqueues’ is closed to new replies.