# Embedding css file for specific page only

**URL:** <https://forum.pinegrow.com/t/embedding-css-file-for-specific-page-only/8059>\
**Category:** Styling (CSS)\
**Created:** [May 25, 2023, 9:52am UTC](https://forum.pinegrow.com/t/embedding-css-file-for-specific-page-only/8059 "2023-05-25T09:52:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![amersaw](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/amersaw/32/5683_2.png) [@amersaw](https://forum.pinegrow.com/u/amersaw)\
**Post date:** [May 25, 2023, 9:52am UTC](https://forum.pinegrow.com/t/embedding-css-file-for-specific-page-only/8059/1 "2023-05-25T09:52:00Z")

</div>

Beside the `index.html` page I have a special pages that I need to embed a CSS file only for it and shouldn’t be embedded with other pages.

I use case for that is when I have RTL styling that should be included only with that RTL page.  
The issue is whenever I include some link to that rtl css, it get automatically get embedded with all other pages (including index.html one).  
I tried to change the page settings to :

- [page-rtl.html] → Enable the `This is a master page with its own header & footer` option
- [page-rtl.html] → Enable the `Don't export template parts`

But all css links mentioned on every page get embedded with every page, which I’m not expecting.

My question:

- is this the normal behaviour to embed every mentioned css links on every pages ?
- If I’d like to embed a special css file with 1 specific page, how can I do it ?

Note: I’m using the WP plugin designer not the desktop app, where I noticed that it contains libraries management that I couldn’t find in the WP plugin.

---

<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:** [June 1, 2023, 12:18pm UTC](https://forum.pinegrow.com/t/embedding-css-file-for-specific-page-only/8059/2 "2023-06-01T12:18:52Z")

</div>

- is this the normal behaviour to embed every mentioned css links on every pages ?  
Yes, PG will collect all JS/CSS files and add them to the functions.php file unless you mark that file as “Don’t Export” in the WP actions.

- If I’d like to embed a special css file with 1 specific page, how can I do it ?  
You’ll need to write a custom piece of code so that the CSS file only gets [enqueued on your specific page](https://wordpress.stackexchange.com/questions/39130/how-to-conditionally-enqueue-a-stylesheet-only-for-a-certain-pages).

I’m not sure about the flexibility of the Plugin version of Pinegrow but in the desktop app, you would put that code in your inc/custom.php file. You can also look for a plugin that allows you to add PHP to your site, but I don’t like using plugins like that because it creates potential security issues.

---

<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:** [June 2, 2023, 2:40am UTC](https://forum.pinegrow.com/t/embedding-css-file-for-specific-page-only/8059/3 "2023-06-02T02:40:59Z")

</div>

@amersaw you can also use Condition action on the link / script elements to control conditions under which the resource loads:

> **[Including Scripts and Styles | Pinegrow Web Editor](https://pinegrow.com/docs/wordpress/enqueue-scripts-and-styles/#conditional-enqueueing-requires-pg-5-92-or-tc-1-3)**
>
> Controlling how script and style resources are included into exported WordPress theme.

There is also an approach of using a special settings.html page for defining all resources, that is suitable for keeping things organized in more complex projects:

> **[Including Scripts and Styles | Pinegrow Web Editor](https://pinegrow.com/docs/wordpress/enqueue-scripts-and-styles/#handling-complex-projects-with-multiple-master-pages-with-their-own-stylesheets)**
>
> Controlling how script and style resources are included into exported WordPress theme.
