Two sections of same site with very different presentation - how?

I’m building a site that has a custom backend for members (not the Wordpress admin) that is styled completely differently than the frontend for consumers. Different header, footer, and css. Both sections have very complex pages that require custom templates for about 80% of the pages (done by specifying the default template in Wordpress and using content-page-{slug}.php in the Sage templates directory. All the member site pages are children of a root member page, so I can loop through the page ancestors to figure out which site the user is on.

I was planning on writing conditional logic in the setup.php and base.php files to pull the correct css, header and footer files, but wanted to see if anyone here had any thoughts on a more efficient way to do this.

Conditional logic :+1:

I’ve setup my own functions for conditionals based on certain rules to define what ‘section’ of a site you’re on, and then use those conditionals to serve different template partials.

I also use the same conditionals to apply a <body> class that’s used when doing all the styling.

Thanks, benword. Nice to see I had the right idea. And I like you idea of using a different body class for the css, though I’ve already set up the sass structure for the other css file. I assume I can use the same conditional logic in the setup.php file to specify which css file to use.

This is the most complex Wordpress site I’ve created using Sage and I have to say that I’m quite pleased with how well it is working out. Once you get past the learning curve, it’s really quite flexible.

1 Like