Thumbnails in Archives and Categories
Posted by Asuka_Aki | Posted in Uncategorized | Posted on 12-09-2008 |
If you look at my Archives or Categories you will see that they contain thumbnails from an image within the post. They are also listed as short excerpts so readers can view many blog entry titles at once.
The idea of using excerpts is also to increase page views. An extra click is required to read the entire article. Check out my archives for a live demo.
1–Add Custom Field to display an image.
- When you’re done editing a blog entry scroll down to “Custom Fields”
- Under “key” add the word “thumb” for “value” add the url of the image you want to use as a thumb.
- Hit “Add Custom Field” and save your blog entry.
2–Some themes have the Archives and Categories show full posts one after the other. I changed this to excerpts.
- From the admin panel click: Design >Theme Editor.
- Select Archives and look for “the_content” (without quotes)
- Change “content” to “excerpt” and that’s it.
3–Add a bit of code to display the thumbnail in the Categories and Archives pages.
- Just before the line that contains “the_excerpt” add the following code:
<a href="<?php the_permalink() ?>" title="<?php the_title(); ?>">
<img src="<?php $values = get_post_custom_values("thumb"); echo $values[0]; ?>" width="100px" alt="<?php the_title(); ?>" class="thumb" />
</a> |
![]()
That’s all there is to it. Leave your questions or comments I am always happy top read and help you if I can.
If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!




[...] When you write a post create a custom feild called “thumb” and add the name of the image as the value. See this post for further explenations on custom feilds. [...]