is there a way to auto-link my custom css file to each new page?

Permalink
Currently I have my own custom css file sitting sitting in the root level concrete5's css folder, but it does not appear to auto-load. So, for each page I create, I need to link my custom css file in the head section.

Rather than manually linking each page I create to my custom css file, is there a way that I can get it to auto-load for each page?

View Replies: View Best Answer
enlil replied on at Permalink Reply
enlil
This is an example taken from Greek Yogurt theme. You need to include something similar in you theme's header.php file, directed to your custom css file.

<link rel="stylesheet" media="screen" type="text/css" href="<?php echo $this->getStyleSheet('main.css')?>" />
jwapp replied on at Permalink Reply
What directory holds that header.php file?
enlil replied on at Permalink Reply
enlil
It can depend on which theme you're using, but typically you can find it in your THEMENAME/elements folder
jwapp replied on at Permalink Reply
Hmm, looks like for the theme I bought, it's located here:

~/public_html/packages/THEMENAME/elements/THEMENAME/common/header.php

It doesn't seem to recognize my custom css file located here: ~public_html/css/myFile.css

What should be path be in the php line of code you provided above to get to my css file? I tried, ...getStyleSheet('/css/myFile.css')... but no luck.

I made sure to add your line of code as the very last line in the file.
enlil replied on at Permalink Reply
enlil
that code assumes the css file is directly in the THEMENAME folder i believe...
jwapp replied on at Permalink Reply
but, won't everything get overwritten when the theme updates?
enlil replied on at Permalink Reply
enlil
absolutely correct! Once you figure out what works, you want to make the appropriate overrides in the appropriate folders to make sure that does not happen. That was my next message after you, hopefully, told me it was working :)
jwapp replied on at Permalink Reply
OK, if I place it in that folder it works. Do I then need to build the same folder hierarchy starting from the root, but without the packages folder? That is, I create this directory:

~/public_html/THEMENAME/elements/THEMENAME/common/

and copy in header.php then edit it to insert the line of php code?
enlil replied on at Permalink Best Answer Reply
enlil
public_html/themes/THEMENAME/elements/THEMENAME/common/header.php

And yes, then make the edits to this file!