How To Remove The Sidebars From Your Custom Post Types in Thesis

With the recent release of WordPress 3.0 I’ve been creating some truly unique sites utilising the Thesis Theme in co-ordination with the latest features. Whilst custom post types and taxonomies in Thesis have been well documented elsewhere; one thing that caught me at the last hurdle was the ability to remove sidebars from custom posts whilst leaving them active for standard posts.

After brainstorming different methods and scouring blog and forum posts I finally pieced together a solution that worked. As I didn’t see it mentioned anywhere else, I figured that I would share just in case anyone else finds themselves in a similar situation.

function remove_custom_post_sidebars() {
if( get_post_type() == 'custom_post_name' ) {
?>
<style>
#sidebars { display: none; }
#content  { width:100%; }
</style>
<?php
}
add_filter('thesis_hook_before_html', 'remove_custom_post_sidebars');

Simply copy and paste the above into your custom_functions.php file and then edit the bit that says 'custom_post_name' to whatever your actual custom post type is called. Pretty simple once you know how ;)