Ver Mensaje Individual
  #8 (permalink)  
Antiguo 12/02/2013, 11:57
Avatar de javiandgo
javiandgo
 
Fecha de Ingreso: septiembre-2010
Ubicación: Cumaral-Meta, Colombia
Mensajes: 457
Antigüedad: 13 años, 7 meses
Puntos: 55
Respuesta: Función dividir líneas en títulos wordpress ?

Tambien puedes usar esto

Código PHP:
Ver original
  1. // Esto va en el function.php
  2. function titulo_corto($separador = '', $length) {
  3.     $mytitle = explode(' ', get_the_title());
  4.    
  5.     array_splice($mytitle, $length, 0, $separador);
  6.  
  7.     $mytitle = implode(" ",$mytitle);
  8.  
  9.     return $mytitle;
  10. }

Y lo llamas en el loop asi:

Código PHP:
Ver original
  1. <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php echo titulo_corto('<br/>', 5); ?></a></h2>

<br> seria el separador y 5 la posicion donde debe ir el separador.

Última edición por javiandgo; 12/02/2013 a las 12:10