# How conditions work in PineGrow?

**URL:** <https://forum.pinegrow.com/t/how-conditions-work-in-pinegrow/3654>\
**Category:** Pinegrow WP\
**Created:** [January 3, 2020, 6:31am UTC](https://forum.pinegrow.com/t/how-conditions-work-in-pinegrow/3654 "2020-01-03T06:31:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![LauGau](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/laugau/32/2390_2.png) [@LauGau](https://forum.pinegrow.com/u/LauGau)\
**Post date:** [January 3, 2020, 6:31am UTC](https://forum.pinegrow.com/t/how-conditions-work-in-pinegrow/3654/1 "2020-01-03T06:31:00Z")

</div>

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](https://canada1.discourse-cdn.com/flex036/uploads/pinegrow/original/2X/d/da52dd0914143af275077bb45dc7809e027d9fb1.png)

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

---

<div class="post-metadata">

**Author:** ![jonroc](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/jonroc/32/2805_2.png) [@jonroc](https://forum.pinegrow.com/u/jonroc)\
**Post date:** [January 4, 2020, 7:36pm UTC](https://forum.pinegrow.com/t/how-conditions-work-in-pinegrow/3654/2 "2020-01-04T19:36:48Z")

</div>

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](http://docsbeta.pinegrow.com/how-to-add-code-snippets-to-functions-php-file/)  
[Conditionally enqueue files in functions.php](https://dobsondev.com/2015/06/05/conditionally-enqueue-stylesheet-into-wordpress-for-certain-page/)

---

<div class="post-metadata">

**Author:** ![matjaz](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/matjaz/32/5_2.png) [@matjaz](https://forum.pinegrow.com/u/matjaz)\
**Post date:** [January 10, 2020, 3:32pm UTC](https://forum.pinegrow.com/t/how-conditions-work-in-pinegrow/3654/3 "2020-01-10T15:32:45Z")

</div>

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:

> **[Including Scripts and Styles | Pinegrow Web Editor](http://pinegrow.com/docs/wordpress/enqueue-scripts-and-styles/)**
>
> Controlling how script and style resources are included into exported WordPress theme.
