StudioPress Community Forums

StudioPress Community Forums (http://www.studiopress.com/support/index.php)
-   General Discussion (http://www.studiopress.com/support/forumdisplay.php?f=7)
-   -   Thumbnails in archive pages (http://www.studiopress.com/support/showthread.php?t=5628)

glampinggirl 02-27-2009 03:30 PM

Thumbnails in archive pages
 
Hi, I was wondering if it was possible to have the category archive pages show thumbnail images instead of the full sized image in the post. Is this an easy thing to code?

adew 02-28-2009 02:04 AM

Re: Thumbnails in archive pages
 
Hi,

Yes. You could try something like this. Find this in archive.php:
Code:

<?php the_content(__('Read more'));?><div style="clear:both;"></div>
and replace it with this:
Code:

<?php if( get_post_meta($post->ID, "thumbnail", true) ): ?>
[img]<?php echo get_post_meta($post->ID, [/img]" alt="<?php the_title(); ?>" />
<?php else: ?>
<?php endif; ?>
<?php the_content_limit(80, ""); ?>
<div style="clear:both;"></div>

This will also replace the full post content with an excerpt. You may have to play with the CSS to get this to look right. Take a backup of archive.php before you begin - just in case. :)

glampinggirl 02-28-2009 10:00 AM

Re: Thumbnails in archive pages
 
This works great, thanks for the help!!

adew 03-01-2009 09:32 AM

Re: Thumbnails in archive pages
 
Great! Glad it worked. :)


All times are GMT -5. The time now is 04:10 PM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.