This took me a little while to figure out, but I finally cracked it so in the spirit of these forums I thought I would post my solution in the hope it helps someone trying to do something similar. So, for anyone working on a portfolio style theme and wanting to create a thumbnail gallery of their work in the category archives that doesn’t display any text associated with the post, here goes -
First add thumbnail support, I am specifying a custom size to display in the chosen category, chose whatever suits you and don’t forget to download and run the regenerate thumbs plugin for these to take effect:
//Add Post Thumbnails Support
if ( function_exists( 'add_theme_support' ) ) { // Added in 2.9
add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 150, 150, true ); // Default thumbnail size
add_image_size( 'category-thumbnail', 300, 300 ); // Category thumbnail size
}
Second, create a custom post title that includes the thumbnail for your chosen category:
//Put the thumbnail in the post title
function childtheme_post_title($title) {
if (is_category('drawing')) { ?>
<a href="<?php the_permalink() ?>" rel="bookmark" class="entry-thumb"><?php the_post_thumbnail('category-thumbnail'); ?></a>
<?php
} else {
return $title;
}
}
add_filter('thematic_postheader', 'childtheme_post_title');
Lastly, create a custom category loop for the chosen category that only displays the thematic_postheader:
//Creating the content for the Category
function remove_category_loop() {
remove_action('thematic_categoryloop', 'thematic_category_loop');
}
add_action('init', 'remove_category_loop');
function childtheme_category_loop() {
if (is_category('drawing')) {
while ( have_posts() ) : the_post();
thematic_abovepost(); ?>
<div id="post-<?php the_ID() ?>" class="<?php thematic_post_class() ?>">
<div class="entry-content">
<?php thematic_postheader() ?>
</div>
</div><!-- .post -->
<?php
thematic_belowpost();
endwhile;
} else {
while (have_posts()) : the_post();
thematic_abovepost(); ?>
<div id="post-<?php the_ID(); ?>" class="<?php thematic_post_class(); ?>">
<?php thematic_postheader(); ?>
<div class="entry-content">
<?php thematic_content(); ?>
</div><!-- .entry-content -->
<?php thematic_postfooter(); ?>
</div><!-- #post -->
<?php
thematic_belowpost();
endwhile;
}
} // end category_loop
add_action('thematic_categoryloop', 'childtheme_category_loop');
These are the basic steps and can be modified and styled to your choosing. Hope it helps someone.