0

I'm about to start a website where I'll need to have a different "feel" in design, and in information displayed, for each section.

So, for instance, when you go to the "chocolate" section the design has to be brownish overall (pages, posts and archives), and the sidebar should show chocolate-related material. When you go to the "candy" section, it should be a "pink" design with a sidebar displaying info about candy, and so forth...

How can I achieve this? Do I need a Multi-Site installation? Is there a downside to using a Multi-Site install for this purpose?

  • 1
    I don't see why you'd need multisite for that, it would be fairly simple to achieve with the template hierarchy and some css. – Milo Mar 24 '15 at 19:10
  • I'll second Milo on that. With a little planning, good use of WP body_class and well-written CSS, there is no need for WP MS. codex.wordpress.org/Function_Reference/body_class – jdm2112 Mar 24 '15 at 19:13
  • Thank you very much guys! Milo, you're a genius dude. I remember you from an answer I read on another thread, it was a genius solution for stripping the "category" from links to category pages. Thank you for this and for that one! Sucks that I cannot upvote. – Eric Liddel Apr 15 '15 at 19:56
1

Multisite isn't really the best option here.

If you need different layouts and styles for, say, the header on different pages, you can use the is_page function to call a different header file depending on which page the user is on.

So to load up a different header on your home page as opposed to any other page, in your index.php (or other page template) add: if ( is_page('home') ) { echo get_header(home) }

In this case you'd need a file called "header-home.php" that contains all the necessary code for that custom header, with any classes/id's for items specific to that page so you can style them appropriately.

If you want a quick and easy (but not technically correct) way of doing it, you can just wrap some inline styles in an is_page function, so that those styles are only applied if a user is on that page. But if it were me I'd just load up custom template files to avoid inline styling.

Here's the function reference for is_page()

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.