Categories: ThemesTips & Tricks

Jon Asked: How to add thumbnails above post on the THiCK theme

I was asked by a reader:

I’m using the THiCK theme for my new design blog. I noticed you were able to add thumbnail images above your blog posts on the home page. What would I need to do to enable this on my blog?

Well Jon, this can be done very simple, since the theme is already using the Tim Thumb script.

What you will need to do is find in your index.php file, the second loop. Which you can find on line 40.

<?php query_posts('offset=1&showposts=' . get_option('woo_other_entries') . '&cat=-' . $GLOBALS['ex_asides'] ); ?>

<?php while (have_posts()) : the_post(); ?> 

 <div class="post">
  <h2><a title="Permanent Link to <?php the_title(); ?>" href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2>
  <div class="post-meta"><?php the_time('j/m/y'); ?> <span>|</span> <?php comments_popup_link('0 Comments', '1 Comment', '% Comments'); ?></div>
  <?php the_excerpt(); ?>
 </div>

<?php endwhile; ?>

Now we are going to add in the code. At line 43 we are going to add:

<?php if (get_option('woo_resize')) { // Check if we should use the image resizer ?>
                    <a title="Continue reading this entry..." href="<?php the_permalink() ?>" rel="bookmark"><img src="<?php echo bloginfo('template_url'); ?>/thumb.php?src=<?php echo get_post_meta($post->ID, "image", $single = true); ?>&amp;h=80&amp;w=280&amp;zc=1&amp;q=90" alt="<?php the_title(); ?>" /></a>
                <?php } else { ?>
                    <a title="Continue reading this entry..." href="<?php the_permalink() ?>" rel="bookmark"><img src="<?php echo get_post_meta($post->ID, "image", $single = true); ?>" alt="<?php the_title(); ?>" /></a>
                <?php } ?>

That’s it, just make sure that in the THiCK options panel you choose the “resize” option, or the image might break the layout. Or you may change the this code: $post->ID, "image", to: $post->ID, "image_thumb", and use a separate image for the lower blog.

Web Master

Hi, I am Miguel, I bought this site in 2009. So I now run or manage the site. Please visit my new website or follow me on twitter @W3i.

View Comments

Recent Posts

Thematic Framework

I guess I will show off the the theme which I am using for this…

5 hours ago

WP-Membership

WordPress has emerged as not only a leading blogging platform but also a content management…

7 hours ago

Simple SEO: WordPress

Properly configured, Wordpress can be an extremely effective way of designing, maintaining and managing your…

19 hours ago

WordPress 2.7 Beta 3

WordPress 2.7 Beta 3 has been released for your testing pleasure. Here are some of…

1 day ago

How to: Add a contact me via Skype™ button

This little trick is really simple and easy. All you need to do is plug…

2 days ago

Review: WP-DBManager

This powerful plugin is a must-have for WordPress users. With WP-DBManager you can manage your…

2 days ago