How conditions work in PineGrow?

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:
Screenshot 2020-01-03 at 13.28.00

How does conditions work in Pinegrow?
How can I enqueue scripts and CSS only on a specific page?
Thanks ! :slight_smile:

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.

How to add code snippets to functions.php
Conditionally enqueue files in functions.php

Easy conditional script and style enqueueing is coming soon, in the next PG update. It works by placing conditional actions on styles and scripts.

The process is described here: