Ver Mensaje Individual
  #9 (permalink)  
Antiguo 18/05/2011, 22:49
Avatar de j_aroche
j_aroche
Server Ninja
 
Fecha de Ingreso: agosto-2006
Ubicación: iPhone: 14.624481,-90.487457
Mensajes: 2.066
Antigüedad: 17 años, 9 meses
Puntos: 223
Respuesta: Colocar "balazo" al título (periódico digital)

Hola,

¿ Sabes si la plantilla que estás usando tiene el archivo functions.php ? Si lo tiene, inserta este código (puede ser al final) :
Código PHP:
Ver original
  1. function title_prefix($content)
  2. {
  3.         if ( ! in_the_loop()  )
  4.                 return $content;
  5.  
  6.         $antetitulo = get_post_meta($post->ID , 'antetitulo' , true);
  7.         if ( $antetitulo )
  8.                 return "$antetitulo $content";
  9.         return $content;
  10. }
  11.  
  12. add_filter('the_title', 'title_prefix', 10, 1 );

De esta forma, no tienes que modificar el resto de plantillas, con cada llamada a the_title() se agregará el prefijo si el post tiene el custom field 'antetitulo'.
__________________
Blog: JavierAroche.com - Twitter: @j_aroche