# Attach a different CSS file to certain WP pages?

**URL:** <https://forum.pinegrow.com/t/attach-a-different-css-file-to-certain-wp-pages/4546>\
**Category:** Pinegrow WP\
**Created:** [September 22, 2020, 7:40am UTC](https://forum.pinegrow.com/t/attach-a-different-css-file-to-certain-wp-pages/4546 "2020-09-22T07:40:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![snowfeald](https://avatars.discourse-cdn.com/v4/letter/s/57b2e6/32.png) [@snowfeald](https://forum.pinegrow.com/u/snowfeald)\
**Post date:** [September 22, 2020, 7:40am UTC](https://forum.pinegrow.com/t/attach-a-different-css-file-to-certain-wp-pages/4546/1 "2020-09-22T07:40:21Z")

</div>

Any help or pointers would be appreciated : )

---

<div class="post-metadata">

**Author:** ![RobM](https://avatars.discourse-cdn.com/v4/letter/r/278dde/32.png) [@RobM](https://forum.pinegrow.com/u/RobM)\
**Post date:** [September 22, 2020, 11:30am UTC](https://forum.pinegrow.com/t/attach-a-different-css-file-to-certain-wp-pages/4546/2 "2020-09-22T11:30:52Z")

</div>

It depends a little on what the types of pages are that you are adding the styling. Are they custom templates? Are they “static” pages. You can look at the Pinegrow WordPress Conditionals actions. Depending on what the pages are you could use either “IF is\_page\_template” or “IF is\_page”.

> **[Conditional Tags « WordPress Codex](https://codex.wordpress.org/Conditional_Tags)**

---

<div class="post-metadata">

**Author:** ![snowfeald](https://avatars.discourse-cdn.com/v4/letter/s/57b2e6/32.png) [@snowfeald](https://forum.pinegrow.com/u/snowfeald)\
**Post date:** [September 22, 2020, 2:09pm UTC](https://forum.pinegrow.com/t/attach-a-different-css-file-to-certain-wp-pages/4546/3 "2020-09-22T14:09:04Z")

</div>

It’ll be a singular template page, to be honest I have no idea what I’m doing…

---

<div class="post-metadata">

**Author:** ![RobM](https://avatars.discourse-cdn.com/v4/letter/r/278dde/32.png) [@RobM](https://forum.pinegrow.com/u/RobM)\
**Post date:** [September 22, 2020, 2:35pm UTC](https://forum.pinegrow.com/t/attach-a-different-css-file-to-certain-wp-pages/4546/4 "2020-09-22T14:35:20Z")

</div>

Will it have a specific file name like “custom-singular-page.php”, or are you replacing the base WordPress template(s)?

If you do have a specific template name, then within the Pinegrow “inc/custom.php” add in a conditional css enqueue:

```auto
if ( is_page_template( 'custom-singular-page.php' ) ) {
wp_enqueue_style( 'custom-style-name', get_stylesheet_directory_uri(). '/relative/path/to/stylesheet.css', array(), null, true);
}

```

You can also handle it by registering all of your stylesheets and then just enquing by the name. Look closer at the “wp\_enqueue\_style” function to see how you want set the other options.
