drteddy
Member
Posted 7 months ago #
In my blog http://www.drteddy.gr in the front page the template displays the excerpt of the post.
I want to display the_content() of the post depending on the number of the words of the post. I've coded a function that counts the post's words, but I couldn't implement the part I describe above.
Could anyone give me a clue or help?
try This
$max=40;
if ($count> $max) {
the_excerpt();
}
else {
the_content();
}
drteddy
Member
Posted 7 months ago #
It doesn't work....
For some reason the if statement always returns the part of the code that included in "else" section....
Giving some more tries...
I've coded a function that counts the post's words
instead of $count use the returned value from that function (don't use echo in your function , but use return).
possibly post the code of that function here - see forum guidelines for posting code.