Where have you found this function called “content()” is it your own func?
I know the get_the_content(), the_content()
May we have some details about this function?
You would need probably to put a condition but without extra details it is a little bit hard to help you
Here is the function…
function content($num) {
$theContent = get_the_content();
$output = preg_replace('/<img[^>]+./','', $theContent);
$output = preg_replace( '/<blockquote>.*<\/blockquote>/', '', $output );
$output = preg_replace( '|\[(.+?)\](.+?\[/\\1\])?|s', '', $output );
$limit = $num+1;
$content = explode(' ', $output, $limit);
array_pop($content);
$content = implode(" ",$content)."...";
echo $content;
}
Are you OK with PHP code?
You probably will need to modify this function and to have a condition checking
- if $content has more than 80 words -> then display the_permalink()
am not a php guy, just got the function from this forum before i realized that i need to have the read mmore not show…can you just do an example and i can run with it and play around with it..
You can remove that anchor tag from the first code snippet and then modify the function so that you include your read more within the get_the_content() function like so:
$theContent = get_the_content( 'Read more' );