0

I would like to know that using multisite feature, is it possible to have exactly same multiple wordpress sites, same content, same themes, (each on its own subdomain) but having few css styles specific to each site?

If so, then how can we achieve this.

3

Yes, you can add website specific class to BODY, for example.

Best approach is to create little multisite enabled plugin, that adds some class to BODY in body_class filter.

function customBodyClass( $classes ) {
  global $current_blog;
  $classes[] = 'website-'.$current_blog->blog_id;
  return $classes;
}
add_filter( 'body_class', 'customBodyClass' );

All themes has to use body_class() function in BODY tag, obviously.

| improve this answer | |
  • Thanks for answering, I really appreciate your effort. If it is possible for you to also illustrate, how can we make site specific options then I shall be immensely thankful to you. Options that are unique to a site. – Omar Tariq May 26 '15 at 13:41
  • If my post answered your question, then you can "accept" it. Site specific options ... well, if you transform this tutorial to stand-alone plugin, and activate it in multi-site, then every site's admin will have its custom options page, and its settings will be site-specific (when called by get_option(...) function). – Marek May 27 '15 at 12:13
  • Thank you very much for your efforts Marek, and sorry for accepting it late. I was like stuck in projects, didn't get time to get back to wp. – Omar Tariq May 27 '15 at 17:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.