Can I make my own custom css for an already custom (non-default) theme?
Hi there.
I'm using the EmbedFriendly theme. I've made some of my own changes to it (in its custom.css folder). When a new version of EmbedFriendly comes out in the future, I'd like to retain these changes. I've taken note of the changes in notepad, but I'm worried when a new version comes out and I have to re-integrate them I might run into trouble (I'm not good with computers) and this would not be good for my forum users. I'm wondering if there's a more efficient way to do it?
I was thinking of switching the EmbedFriendly theme to the default theme folder and then making my own cusom theme for it, except there's no css files in the default folder. I read the readme in the default folder but I'd like clarifications, because I don't understand.
Thanks so much in advance for any assistance, it's greatly appreciated!
Best Answers
-
sahotataran ✭✭✭
save your file as say : custom2.css in your theme/yourtheme/design/ folder
and then open your embedfriendlythemehooks.phpfind Base_Render_before hook and
add
$Sender->AddCSSFile('custom2.css');
your css will be added in the end and will apply your changes to your theme styling
There was an error rendering this rich post.
1 -
sahotataran ✭✭✭
Also that "1." confused me, but it seems it only occurred because you put a quote thingy around your text in this forum.
thats the styling for code and pre tags - your dont put it in your themehooks - put the line without 1.
you add the line $Sender->AddCSSFile('custom2.css'); in your themehooks which can be found in yourtheme folder and if there is none then you can create one - refer to documentation for more details on theme hooks.
$Sender is already associated with singlecolumn (allows EmbedFriendly theme to display without right column),
You can add as many CSS files using AddCSSFile function to your $Sender
associating it with something else also won't interfere.
this will not interfere until and unless your CSS you wrote in custom2.css interferes with the CSS already written in your singlecolumn.css or custom.css. so basically your custom2.css definations will override those in singlecolumn.css or custom.css
Also I don't understand how it will know that 'custom2.css' refers to the file in my custom theme folder
the AddCSSFile method looks for your custom2.css in yourtheme/design/ folder and if it doesnot find any then it will not add the custom2.css into the html - so its mandatory to put all your css files in /design/ folder
There was an error rendering this rich post.
0
Answers
save your file as say : custom2.css in your theme/yourtheme/design/ folder
and then open your embedfriendlythemehooks.php
find Base_Render_before hook and
add
your css will be added in the end and will apply your changes to your theme styling
There was an error rendering this rich post.
Thanks so much, that's exactly what I needed!
you are welcome
There was an error rendering this rich post.
Question: Where in the php document should I add that line defining the value of 'sender'? I don't speak PHP, thanks a ton for the help.
Actually looking at it carefully, it appears to be a css page, not a php script. I think I can figure out how to add $Sender->AddCSSFile('custom2.css');
Also that "1." confused me, but it seems it only occurred because you put a quote thingy around your text in this forum.
$Sender is already associated with singlecolumn (allows EmbedFriendly theme to display without right column), so hopefully associating it with something else also won't interfere.
EDIT: The results are successful. The only thing I had to do differently (or maybe I just misunderstood your instructions) was that I put my custom2.css file inside EmbedFriendly's design folder, I did not create a separate theme and design folder.
Thanks again sahotataran for your help.
thats the styling for code and pre tags - your dont put it in your themehooks - put the line without 1.
you add the line $Sender->AddCSSFile('custom2.css'); in your themehooks which can be found in yourtheme folder and if there is none then you can create one - refer to documentation for more details on theme hooks.
You can add as many CSS files using AddCSSFile function to your $Sender
this will not interfere until and unless your CSS you wrote in custom2.css interferes with the CSS already written in your singlecolumn.css or custom.css. so basically your custom2.css definations will override those in singlecolumn.css or custom.css
the AddCSSFile method looks for your custom2.css in yourtheme/design/ folder and if it doesnot find any then it will not add the custom2.css into the html - so its mandatory to put all your css files in /design/ folder
There was an error rendering this rich post.