ClioSport.net

Register a free account today to become a member!
Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

  • When you purchase through links on our site, we may earn an affiliate commission. Read more here.

Wordpress theme templates



  Rav4
Hi,

Having a slight issue with this and just wondering what your solution would be.

Templates are relatively easy to use and construct.

However, if I wish to have a different stylesheet for each sub section of the website, it's a real pain.

Picture this scenario.

www.domain.com/banking
www.domain.com/pensions
www.domain.com/mortgages
www.domain.com/insurance

Now, I want each of those sections and every page within that to be a different style, how would you do it?

With Joomla, this is very easy to do, with wordpress, I am lost.

Now, on the header, I can do an IF/Switch statement saying that if this page = x then the stylesheet = style1.css;

This method is too time consuming and not flexible enough.

Any thoughts on this?
 
  BMW 330ci Clubsport
Use Joomla if you understand it better? Otherwise the only simple work around I could think of is a different wordpress install for each section, which is probably pointless.

Is this for a client that wants to be able to update their site easily?
 

Munday

ClioSport Club Member
  RB 182, 1275GT, C220
I don't even know how you can do that with wordpress as each of the pages is database driven and with normally only 1 page template.
You could install wordpress on each of the 4 folders but that would be a complete ballache!

I would be tempted to use Joomla to be honest.
 
  Rav4
Hi,

Joomla is not that good with SEO and sometimes, over complex, going to be having around 80 pages so wordpress should cope, but yes, agree with your comments. (do like the product though and have used it with other projects)

Multiple installs - possible, but not ideal in this scenario.

It certainly is for a client.

Unfortunately I cannot figure out how to choose different templates!! However, I have modified the code, so I can choose different stylesheets depending on which section and it's corresponding pages :)

This means, I can query the top level page and it will follow to everything else, which is great.

Solution

In this instance, I want to have the page 'banking' and any sub-sequent pages to use stylesheet_banking.css In the header.php file in the template "test" directory, we need to change the code below;

Code:
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
To

Code:
?php if (is_page('banking') || $post->post_parent=="2") { ?>
<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/stylesheet_banking.css" type="text/css" media="screen" />
<?php } else { ?>
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
<?php } ?>
post_parent is required, I derived this number by hovering over the page in the admin menu and it provided me with the number.

Obviously you would have multiple else if's for the other "sections" in question,

Hopefully this should be ok,

This is far from the best way of doing it, however, so far, it is working ok.

Thanks,

G.
 


Top