Got a request from a client to have a specific category page on their WordPress blog running the Thesis theme show full posts (vs. excerpts) for just one category. So I’m going to figure it out and write the steps here for the benefit of humanity.
First, to be clear, I’m not talking about changing ALL CATEGORY PAGES from excerpts to full posts. That can be done easily through the Thesis Display Options. You would change the “Posts” display options to “display full content” and the “Archives” display options to “same as home page”.
What I want to do is show excerpts on every category page except one. You do this by settings up a custom category theme, and Thesis has its own way to do that. A custom category theme wasn’t optimal for this install, so I need to do something different. It’s good to have different ways of doing things. Maybe my method below works for you too.
Here’s what we’re going to do.
- Use the “thesis_hook_before_post_box” hook to check the current category and if it is the “Quick Takes” category, change the $thesis[‘display’][‘archives’][‘style’] value to “content”.
- Use the “thesis_hook_after_post_box” hook to change the $thesis[‘display’][‘archives’][‘style’] value back to what it was before we tweaked it.
Sounds complicated, but it’s only a few lines to add to the /custom/custom_functions.php file in your Thesis theme folder.
function quicktakes_fullpost_setup() { $target_category = "Quick Takes"; //saving the global archives display setting so we can revert later global $thesis, $saved_thesis_display_archives_style; $saved_thesis_display_archives_style = $thesis['display']['archives']['style']; //checking the category, if it's the target category, then set the display to full post $current_category = single_cat_title("", false); if($current_category == $target_category) $thesis['display']['archives']['style'] = "content"; } function quicktakes_fullpost_cleanup() { //we're setting the display archives style back to what it was before we tweaked it global $thesis, $saved_thesis_display_archives_style; $thesis['display']['archives']['style'] = $saved_thesis_display_archives_style; } add_action('thesis_hook_before_post_box', 'quicktakes_fullpost_setup'); add_action('thesis_hook_after_post_box', 'quicktakes_fullpost_cleanup');
Be sure to change the $target_category variable to the title of the category you want to change.
If you want to do the inverse of this, which would be to show the excerpt on just one category page and update show the full post on all others, you would:
- Change the Thesis Display Options for posts to “display full post content”
- Change the Thesis Display Options for archives to “same as your homepage”
- Then adjust line 12 in the code above to set the style to “excerpts” instead of “content.
I hope this helps. Let me know if you have any questions about this or similar customizations for Thesis.