Ver Mensaje Individual
  #9 (permalink)  
Antiguo 12/04/2011, 08:37
Avatar de Nekko
Nekko
Colaborador
 
Fecha de Ingreso: marzo-2008
Ubicación: Buenos Aires
Mensajes: 3.141
Antigüedad: 16 años, 2 meses
Puntos: 656
Respuesta: Hola tengo un problema

Te dejo una alternativa usando otro script.

En tu functions.php, añadí antes del ?>

Código:
*
Original Plugin URI: http://labitacora.net/comunBlog/limit-post.phps
Usage: the_content_limit($max_charaters, $more_link)
*/

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 "...";
        echo "&nbsp;<a href='";
        the_permalink();
        echo "'>".$more_link_text."</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 "&nbsp;<a href='";
        the_permalink();
        echo "'>".$more_link_text."</a>";
        echo "</p>";
   }
   else {
		echo "<p>";
		echo $content;
        echo "...";
        echo "&nbsp;<a href='";
        the_permalink();
        echo "'>".$more_link_text."</a>";
        echo "</p>";
   }
}
En tu index.php (o el archivo que uses para el home) reemplazá the_content() o the_excerpt() por esto:

the_content_limit(350, "Leer mas...");

En donde 350 es la cantidad de caracteres a mostrar y tendrás que ir modificándolo para que se ajuste a tus necesidades (yo probaría con 100).
__________________
Taller para crear themes wordpress desde cero | Presupuestos para trabajos particulares vía MP