eu inca ma folosesc de functia:
function the_content_limit($max_char, $more_link_text = '(more...)', $stripteaser = 0, $more_file = '') {
$content = get_the_content($more_link_text, $stripteaser, $more_file);
$content = apply_filters('the_content', $content);
$content = str_replace(']]>', ']]>', $content);
$content = strip_tags($content);
if (strlen($_GET['p']) > 0) {
echo "<p>";
echo $content;
echo " <a href='";
the_permalink();
echo "'>"."Continua... →</a>";
echo "</p>";
}
else if ((strlen($content)>$max_char) && ($espacio = strpos($content, " ", $max_char ))) {
$content = substr($content, 0, $espacio);
$content = $content;
echo "<p>";
echo $content;
echo "...";
echo " <a href='";
the_permalink();
echo "'>".$more_link_text."</a>";
echo "</p>";
}
else {
echo "<p>";
echo $content;
echo " <a href='";
the_permalink();
echo "'>"."Continua... →</a>";
echo "</p>";
}
}
cod pe care il adaugi in function.php
iar in locul unde vrei sa iti apara postul pui:
<?php the_content_limit(200, "Read More..."); ?>
asta este o varianta mai veche din cate am citit wordpress 3.0 are aceasta functie deja incorporata, dar poti sa o folosesti fara probleme.