Custom Stylesheets for Individual Blogs

Hello!

So on my network i had a request for a few customizations to my themes that i have in place. The only issue is that i want to be able to make these customizations for this particular client but do not want these reflected on the overall template for futiure and current blogs using this setup.

Is there any plugin, or is anyone aware of a quick call that could be placed into the current functions.php file that would essentially say to check the blogid folder of the respective blog for a custom.css & custom_function.php that would allow further customizations to be made that would not affect the overall theme itself?

I came across this post below but was a bit confused on how to properly implement the idea...
https://premium.wpmudev.org/forums/topic/change-theme-colorsimagery-based-on-blog

Thanks a ton in advance for the help!

Erik

  • Timothy
    • Chief Pigeon

    Hey Erik.

    Is there any plugin, or is anyone aware of a quick call that could be placed into the current functions.php file that would essentially say to check the blogid folder of the respective blog for a custom.css & custom_function.php that would allow further customizations to be made that would not affect the overall theme itself?

    Sure it is possible, you could run a check for the blogID and if its the right ID then run the selected CSS. The issue here is when you update the theme you will lose those changes and will need to update it everytime.

    The other issue is where do you stop, what if you have a thousand sites checking through its more PHP to keep processing on every page load.

    http://codex.wordpress.org/Function_Reference/get_current_blog_id
    http://codex.wordpress.org/WPMU_Functions/get_blog_details

    The other option would be to have the CSS included through some options within the theme and stored in the DB of course then each page load its a heavier query.

    The suggestion in the thread you referred to would be to name the css file accordingly as the blog ID and then have the code check if it exist and if it does then include it for that blog. So it would be a conditional statement to check if blog id matches a css file ID an it exists then use it, otherwise not. Very simplistic few of course but you should be able to go from there.

    Take care.

  • Timothy
    • Chief Pigeon

    No problem, if you need anything else then please just let us know! :slight_smile:

    If they are special requests, something real rare and perhaps charged for then you could consider using a child theme and just enable it for that site only. Then no need to worry so much about updates or using more resources on every page load through the network of sites.

    Take care.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.