I've been searching for an answer, but haven't quite found one yet.
I have my posts on the home page truncated, and I'd like to find a way to keep all but the first post truncated. Is there a way to do this?
<?php $excerpt = get_the_excerpt(); echo string_limit_words($excerpt,80); ?>
That's what I'm currently using to display the excerpts on the home page.
Thanks for any help!
Something similar to this might work:
<?php
if (is_front_page() && ++$count == 1) {
the_content();
} else {
$excerpt = get_the_excerpt(); echo string_limit_words($excerpt,80); ?>
}
Thanks for the response vtxyzzy. Though, that doesn't seem to work.
Any other methods/ideas?
Thanks!
<?php
$count = 0;
if ($count > 0) {
$excerpt = get_the_excerpt(); echo string_limit_words($excerpt,80);
} else {
the_content();
}
$count++;
?>
Use this.
Hmmm... chinmoy29, this seems close, but it's displaying the entire post for all posts now...
With my limited knowledge of PHP, it looks like your code asigns the first post the number 0, and then adds 1 to each following post. Which seems right to me. However, it displays the full post for all items...
Move $count = 0; above of the loop
Excellent! That got it!
Thank you guys for all your help!