a:
you would need to remove the sidebar div or sidebar code if there are no widgets;
you can find some ideas for conditional code in sidebar-footer.php of Twenty Ten, for instance;
b:
you would need to have a specific css class for the content in the case of no sidebar, so you can selectively style this in style.css
can you post a link to your site to illustrate what you are working with?
Thanks Alchymyth for the quick reply. “B” would be what I’m looking for.
http://69.36.167.86/upcoming/ is an example of a page where no sidebar is being used, but the content remains at the 640px width. (I’d like this content to not be constrained.)
http://69.36.167.86/about/ is an example of a page that has sidebar content.
example of a page where no sidebar is being used
however, there is still the html structure of the sidebar in the page – therefore you need A: or a ‘display:none;’ css solution.
your site is using a theme with body_class(0 which gives a page specific css class to the body tag:
for instance, .page-id-23 is the one for the page without sidebar content.
in custom.css you could add, for example:
.page-id-23 #sidebar-container { display:none; }
.page-id-23 #content { width:100%; }
copy this for any other page without sidebar content – just change the page ID
btw:
a tool such as Firefox’ add-on Firebug is helpful in evaluating the involved styles http://getfirebug.com/
Thanks again for the reply.
The solution you offered is one that I know about. I’m looking for a default solution that would be more of an “if then” situation. In other words, if there is a sidebar then the width of the wide content would be 640px. However, if there is no sidebar, then the wide content would stretch out to 100% of the page (or 960px).
I don’t wish to create special styles for every page.
I don’t wish to create special styles for every page.
look into page templates http://codex.wordpress.org/Pages#Page_Templates
if there is a sidebar
in your code, there is still the sidebar – although empty – so that idea will not work, unless you look into suggestion a: of my first reply.