W3Counter

The following code allows you to modify the intro text on specific Category archives in Thesis

add_filter( 'thesis_archive_intro', 'thesify_category_intro' );
function thesify_category_intro( $output )
{
    // set intro for featured category
    if( is_category( 'featured' ) )
        $output = '<h1>Featured Posts</h1>';
    // set intro for tutorials category
    elseif( is_category( 'tutorials' ) )
        $output = '<h1>Tutorials</h1>';
    // return the default if not on featured or tutorials
    return $output;
}

The following snippet removes the Thesis Nav menu from selected posts/pages.

It hooks into the template_redirect hook, and selectively unhooks the default Thesis menu from running.

function thesify_hide_nav_on_selected_posts()
{
    // remove nav menu on 'hello-world' post and 'about-me' page.
    if( is_single( 'hello-world' ) || is_page( 'about-me' ) )
        remove_action( 'thesis_hook_before_header', 'thesis_nav_menu' );
}
add_action( 'template_redirect', 'thesify_hide_nav_on_selected_posts' );

Tested on Thesis 1.8 and WordPress 3.0

Props to @lexirodrigo

The following snippet will disable the default Thesis comments link, if the post doesn’t have any comments yet.

function thesify_disable_comments_link( $link )
{
    if( get_comments_number() == 0 )
        return '';
    return $link;
}
add_filter( 'thesis_comments_link', 'thesify_disable_comments_link', 11 );

Requested by @Tastelikecrazy

I’ve built several sites for small businesses. In almost all cases, they have a collection of static pages, and a blog on /blog/. I used to use the No Sidebars page template for all the pages.

Thesis 1.8 makes it even easier to disable sidebars on certain areas of your site. With just a few lines of code, you can disable them on any page, post, posts matching a certain criteria, or any archive page (including specific category archives and tag archives).

Some examples

Disable Sidebar everywhere

add_filter( 'thesis_show_sidebars', '__return_false' );

Disable on all ‘pages’ except the Blog page

add_filter( 'thesis_show_sidebars', 'thesify_no_sidebar_except_blog_page' );
function thesify_no_sidebar_except_blog_page() {
    // if it is a page and not the blog page, disable ( return false ).
    if( is_page() && !is_page('blog') )
        return false;
    // else enable
    return true;
}

Only show sidebars on single posts

add_filter( 'thesis_show_sidebars', 'thesify_sidebar_only_single_post' );
function thesify_sidebar_only_single_post() {
    // if it is a single post, enable it ( return true ).
    if( is_single() )
        return true;
    // else disable
    return false;
}

HTML5′ize your Thesis Theme

September 24, 2010

While adding the new Twitter buttons on Thesify, I noticed that they used the new HTML5 Data Attributes which invalidated my markup. While having an valid markup may not be on the top priority for most people, there’s no reason not to switch.

I used the thesis_doctype and thesis_head_profile filters to change the site’s doctype to HTML5.

Add the following code to your custom_functions.php to switch your Thesis powered site’s doctype to html5.

add_filter( 'thesis_doctype', 'thesify_html5_doctype' );
function thesify_html5_doctype() {
    return '<!DOCTYPE html>';
}

add_filter( 'thesis_head_profile', 'thesify_html5_head_profile' );
function thesify_html5_head_profile() {
    return '';
}

This feature was added in Thesis 1.8 after the initial Thesis 1.8 release. Make sure you download the latest copy of Thesis before trying this out.

Thesis 1.8 introduces a new filter, which enables us to modify the number of teasers that appear on our home page or any other page.

add_filter('thesis_is_teaser', 'thesify_is_teaser');
function thesify_is_teaser($is_teaser)
{
    static $post_count;
    $post_count = $post_count ? $post_count + 1 : 1;
   
    // show 4 feature posts, the rest as teasers on the
    // category archives for Lorem
    if( is_category('Lorem') )
    {
        return $post_count > 4;
    }
    // show 2 feature posts, the rest as teasers on the home page
    if( is_home() )
    {
        return $post_count > 2;
    }
    // inverts the order of feature posts / teasers on the category
    // archives for 'Ipsum'. first 4 posts become teasers, rest featured
    if( is_category('Ipsum') )
    {
        return $post_count <= 4;
    }
    // return the defaults for the rest
    return $is_teaser;
}