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?
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?
What directory holds that header.php file?
It can depend on which theme you're using, but typically you can find it in your THEMENAME/elements folder
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.
~/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.
that code assumes the css file is directly in the THEMENAME folder i believe...
but, won't everything get overwritten when the theme updates?
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 :)
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?
~/public_html/THEMENAME/elements/THEMENAME/common/
and copy in header.php then edit it to insert the line of php code?
public_html/themes/THEMENAME/elements/THEMENAME/common/header.php
And yes, then make the edits to this file!
And yes, then make the edits to this file!
<link rel="stylesheet" media="screen" type="text/css" href="<?php echo $this->getStyleSheet('main.css')?>" />