Ver Mensaje Individual
  #1 (permalink)  
Antiguo 14/03/2011, 15:05
mrbarriga
 
Fecha de Ingreso: mayo-2006
Mensajes: 10
Antigüedad: 18 años
Puntos: 0
Pregunta Ayuda optimizar código php

Saludos, tengo este código para mostrar los últimos post relacionados tomando como referencia el primer tag del post. (Usando Wordpress 3.1)

Código PHP:
<?php ?>
<?php
$tags 
wp_get_post_tags($post->ID);
if (
$tags) {
echo 
'<div id="relacionado"><strong>Quizas te interese leer también:</strong>';
$first_tag $tags[0]->term_id;
$args=array(
'tag__in' => array($first_tag),
'post__not_in' => array($post->ID),
'showposts'=>3,
'caller_get_posts'=>1
);
$my_query = new WP_Query($args);
if( 
$my_query->have_posts() ) {
while (
$my_query->have_posts()) : $my_query->the_post(); ?>
<p><h4 class="relacionado"><a href="<?php the_permalink() ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h4><?php the_content_rss(''TRUE''22); ?></p>
<?php endwhile; 
}
}
?>
Esto me está generando un error en el archivo query.php de wordpress que si bien no afecta el sitio, afecta la carga de php en el servidor y además me ocasiona problemas con algunos plugin como el de facebook comments.

¿Puede alguien ayudarme a optimizar este código y/ó arreglarlo para que no me de error? Muchas gracias de antemano.