Please note: This page contains affiliate links. If you purchase from a partnership site, I may earn a commission.

Teasers and Thesis Theme for WordPress

Thesis Theme offers an enormous amount of customizing options for your WordPress layout. Teasers is one of my favorite features because displaying excerpts of a post in various locations can greatly increase your page views.

Recently I was trying to figure out how to display a different number of teasers on my front page vs the number displayed on archive pages. Googling for answers I didn't find much but then I remembered that last year I wanted to display all the posts for a category on a single archive page, so I dug up my old code and it worked like a charm for what I wanted to do today. Here's how:

  1. First set the number of teasers you want to display on your front page.
  2. In the standard WordPress admin, view the “reading” page and set your front page “posts to display” number.
  3. If you want to display some full posts along with some teasers on the front page, make sure to add the two together when setting your posts to display number.
  4. If you would like both full and excerpt listings, you'll now need to move to your Thesis “thesis options” (1.6 or below) or “site options” (1.7 and above) menu.
  5. Here look for “home page display” and then choose the number of “featured posts to display”. These will display as full posts, anything else will be a teaser. So, for example, if you have set 5 posts to display in the WP reading admin, and then you select to feature 2 posts in the thesis menu, you'll end up with 3 teasers on the front page. Archive pages will show 5 posts (full or teaser depending on your teaser settings… that's another set of options).

Now the fun. To allow for a different amount of posts on your archive pages, you'll have to dig into some code.

Navigate server files to:

  • wordpress install > wp-content > themes > your thesis install > custom
  • in this directory there should be a file called “custom_functions.php”

now add the following code to your custom_functions.php file:

function archive_posts() {
global $query_string;
if (is_archive())
query_posts($query_string . ‘&showposts=1000');
}

add_action(‘thesis_hook_before_content','archive_posts');

Make sure to change the variable “1000” to whatever number of posts you want displayed on your archive page. Again, if you want these to be full posts vs teasers, you can adjust this setting via the Thesis admin panel. “1000” is used as a way to display all posts on the single archive page.

So for me, I wanted 3 posts on my front page, teasers only and I wanted to show 10 posts on my archive pages, all teasers.

So my settings are:

WordPress posts to display: 3

Thesis options, 0 featured posts on front page

Teaser settings, all teasers – archives displaying like front page

and then this code snippet I have query_posts($query_string . ‘&showposts=10

Voila, that's it!

Join the FREE Creative Club!
Get tutorials, free file downloads and project ideas right in your email.

2 thoughts on “Teasers and Thesis Theme for WordPress”

  1. Hi Jen. It’s nice that you’re interested in Thesis theme, and ironically on a blog that isn’t being run with it. 😉

    One thing, aren’t you missing a “remove_action(”,”);” line? If this is one’s only hack, I think removing is needed.

    Reply

Leave a Comment

100 Directions is about trying something new, sharing creativity in every direction: Art, Travel, Food and sometimes Biz.
I work with a variety of companies to share ideas and insight about products, services and all kinds of fun, creative things to do.
I stand behind my recommendations and hope you love the things I share as much as I love sharing them with you!

 

Privacy Policy | Work with me

 

100 Directions is a JGoode Designs property. Copyright © 2011- Jen Goode. All Rights Reserved.