View Single Post
Old 01-07-2009, 07:00 PM  
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,327
this could do what you want, unless im getting misinformed by your post

Code:
<?php

// this can go in functions.php in your theme directory
function word_split_content($words=15) {
$str = get_the_content('');
$a = preg_split("/[\s]+/", $str,$words+1);
$a = array_slice($a,0,$words);
$final_content = join(' ',$a);
echo $final_content;
}
?>


<?php get_header(); ?>

<?php
    $recent = new WP_Query();
    $recent->query('showposts=5');
?>

<?php while ($recent->have_posts()) : $recent->the_post(); ?>
<h3><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3>
<?php word_split_content(50); ?>
<?php endwhile; ?>

<?php get_sidebar(); ?>

<?php get_footer(); ?>
my icq is 704-299 let me know exactly how you want it done, i will do it free of charge.
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


WP Stuff
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote