Jump to content

Echoed class being ignored?


afish674
 Share

Recommended Posts

In the Wordpress template i'm developing a class is returned dependent on the existance of a sidebar like so:

<div id="main" class="<?php echo roots_main_class();?> round-corners wborder" role="main">		<?php include roots_template_path(); ?>	  </div>

However, although this class is picked up in Firebug on the left, on the right panel it is not detected, meaning any rules applied to it are not working. Any idea why is this happening? Picture of problem in firebug (the class I want to style to 100% width is called "no-side") echo-class-prob.jpg Thanks!

Edited by afish674
Link to comment
Share on other sites

If there are no rules set for the class anywhere, IT wont show it, it will only show those that relate to that specific element in order of precedence. Wait, the id width setting will take precendence over all, that is why it is not showing if you have not already set it, you would have to use #main .no-side {width:100%;} You would have to remove the width from #main and apply it to two new classes, one for normal width: 801px; and other for 'no-side' of the classes that this width would be used on, then use for example #content .no-side {width: 100%} #content .normal {width: 801px} and get php to show one or the other when required.

Edited by dsonesuk
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...