Hi ;
I am quite new to PG and I was trying to enqueue some Scripts and CSS conditionally (only on a specific page) but I cannot make it work… I succeed to enqueue the scripts normally and added an IF statement like this but they are loaded on every page… here is my settings:
How does conditions work in Pinegrow?
How can I enqueue scripts and CSS only on a specific page?
Thanks !
Hi, this is one of the major week areas of PG. There is no easy way to conditionally control which scripts load on which page (for WordPress or HTML5 pages). PG looks through your site on the PG side (not using PHP like you’re trying to do) and finds any call to a .js file or .css file and automatically adds it to your functions.php (unless you use “do not enqueue”. The only way you can control this is to add a condition in you functions.php code to only include that file on the home page.