Remove right sidebar from all "pages"?

I'm using the three column layout and I'd like to remove just the right sidebar from all pages (as opposed to the front page, blog posts, etc... Those should remain 3 column). It looks like it would be easy to copy and modify the thematic_sidebar function to do this by having it call on a modified version of the sidebar.php file (in the child theme) that just has the right bar commented out. I'm new to thematic and child theme modification (I'm a recent convert from gut hacking themes) so I feel like there is a little piece of the puzzle I'm missing and I hope someone can provide it.

Or maybe I've got it all wrong and I need to be set in a different direction.

Helga, when I first read through the second link you provided above, I couldn't figure out what you were referencing. Then I went through and read each post, realizing that the thread was derailed halfway through to something very relevant to my question.

The feeling I came away with is that my question is a common one for someone of my skill level who is developing a Thematic child theme, but that, while you have offered some theoretical suggestions, no one has come up with a solid answer to the question.

Would it be kosher to offer to pay for a solid answer that would be released to the community? If so, do you know who in the Thematic community commonly freelances in this way? It seems like something that could be parsed out in 25-30 minutes for someone who really knows what their doing. I'm willing to pay $25-30 via Paypal for a solid answer to my specific question with an eye toward making that answer accessible to others who want X sidebar on Y page only.

yes it is a very common question, i've answered this question personally more than once. the search here isn't the best, but that post IS the solution. i've used it myself to switch off the secondary aside in certain places.

ok- since the left sidebar (which i am presuming is the Primary Aside) is always on, we don't need to monkey with that. we then point the secondary aside to its new function. upon closer inspection i realized that you had an extra ['args'] in your attempt. that is not where the 'function' parameter lives (it lives at $content['Secondary Aside']['function'] ) , so your function was never being called. sharper eyes in the morning i guess. this actually means you never even GOT to the point of testing your conditional logic, b/c your function was never being swapped into place.

now to "translate" those 2 posts into "show the secondary aside on anything that isn't a page"

the function that displays the aside by default has this bit of conditional logic:
if (is_active_sidebar('secondary-aside'))

which only tests if there is a widget in the defined widget area. well we want to run more tests... so we need to tack on an AND or the other way to write it && (i dont honestly know the difference between AND and && and they both probably work)

you don't want it on any "page". so that says... ok let's test for a page with wordpress's is_page() logic, and let's use the NOT ! modifier to make it negative

if (is_active_sidebar('secondary-aside') && !is_page() )

if your front page is your blog... which would satisfy is_home() then you are done and the above would work just fine. if your front page is an actual page and you'd like to still show the secondary aside then you must get a little trickier.

what has happened here? the vertical pipes mean OR. same as w/ the AND versus && i don't really know if there is much difference. if you are less familiar w/ php, OR is probably more readable. anyway, with parens i've grouped (is_front_page() || !is_page() ) so that if one of those is true, AND the sidebar is active, the secondary aside will display. is_front_page() is how you test for the page that has been set to be the static home page.

since i don't know whether your home page is static or a blog i gave both options.

i've left it with the assumption that you have a static home page, but you can scale it back if you aren't.

For those in the future who may try to use this piece of code to accomplish something similar,

Keep in mind that I was only trying to remove one sidebar. If you reference the other thread where helga posted similar code which addressed a problem dealing with two sidebars (http://forums.themeshaper.com/topic/alternating-sidebars-depending-on-homepages), then it seems like you will be able to cobble the two together, along with conditional tags which helga has discussed above, to accomplish what you need.

My client has also requested that this feature be available on posts. I have played with the is_single conditional tag a bit, but I keep causing critical errors and I'm really sure how the syntax should work so that I can also define posts as having only two columns? Is there a simple fix for this?

I tried that method, maybe I just got something wrong in the syntax. To clarify, we're only going to add a few of the many blog posts to this declaration. So some of them will have two columns but many of them will have three.

so you need to toggle whether the sidebar displays on a per post basis? i did that one time w/ a metabox, so you could set a custom field or a metabox and capture some meta data and then test for that meta value in your conditional

Does the conditional need additional logic to search for the meta value or should I just be able to plug that into !is_single('VALUE')? The WP codex page makes it seem as though these conditionals will except a wide variety of variable without further qualification, hopefully it is so in this case.

you'll definitely need extra info.. b/c you'll need to get the metabox value and test against IT. you could do a fullblown meta box ( i use WP Alchemy on almost every project) but it might be overkill for a radio input. devin also put together a nice tutorial on basic metaboxes (its for custom post types but you can easily extract it to posts. or you could just use a custom field if you don't care for a GUI.

you'll also need to global $post in your child_2nd_subsidiary_aside function i think.

so assuming you are saving a meta value of 'hide' for the meta key 'kia_sidebar'. something like:

I tried devin's code and couldn't get it to work, kept getting a critical error on the first non-comment line of code. I assume it works, as others seem to be happy with it in the comments. Not sure what's going on.

I then switched to just using the custom field box. I have the name and meta as you have defined them and the code doesn't break the site, but it's not functioning.

It seems to me that the lines of PHP you provided are not meant stand on there own and if I knew the slightest about what I was doing, I'd know exactly how to make them talk to the existing code. This is my sorry attempt at that. Am I even on the right path?

Okay, so I realized my above code was actually breaking the previous functionality, so clearly it wasn't working. I've tried coming at it from a different angle, using the previous function as a template and renaming the new function so that it wasn't a duplicate.

So, I believe I should be able to start tinkering with the actual logic and feel relatively sure that that everything is hooked up correctly, if not as elegantly as it probably could be. Again, any direction is greatly appreciated and thanks for everything you've helped me out with so far.