Hi all,
I want to show some snippits of my blog posts with an image, and strip some text from the discription.
this is the code i have and what worked:
<div id="text1">
<?query_posts(array(
'showposts' => 4,
'offset' => 9,
'random' => true,
'category__not_in' => array(95,145,226),
));?>
<div>
<table width="100%" border="0">
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<tr>
<td><img src="<?php echo bloginfo('template_url'); ?>/thumb.php?src=<?php echo get_post_meta($post->ID, "image", $single = true); ?>&h=57&w=100&zc=1&q=95" alt="<?php the_title(); ?>" class="th1" /> </td>
<td><a title="Link to article <?php the_title(); ?>" href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a>
<p>
<?php the_content();?>
</td>
</tr>
<?php endwhile; ?>
</table>
</div>
<?php else: ?><p>No messages!</p><?php endif; ?>
</div>
The problem:
1. How to limit the text (for example) 20 words? I have take a closer look to the excerpt plugin, but that doesn't work for me. This is because i'm using this script also on my frontpage. Don't know how to fix this?
2. How to show only the first image of the post?
Now at the frontpage the script shows the right image, but if i go to the next page, the script shows all the images, without thumbnailing them.
So experts, eat your heart out!