php – Automatically add custom CSS to new posts using a category template

Question

I have inherited the task of modifying a WordPress site (using a child theme). I’m a designer, not a code or back-end expert. I have been customising a set of pages on a site to have alternative styling from the rest of the pages, using a plugin that allows custom CSS to be applied to individual pages. However, I need to get to a stage where this modifying CSS is automatically applied to new posts with a specific category, rather than the author having to do it. I have worked out how to set up a category specific post template (having followed tutorials), but I have no idea how apply my custom CSS to this PHP template. I assume it doesn’t just get added to the PHP template file (I tried that and the code appeared as text). Any pointers greatly appreciated.

0
Matt Buckley 6 months 2022-02-07T13:25:12-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse