Generador de sugerencias de entradas en PHP

  • Autor Autor Kakkonen
  • Fecha de inicio Fecha de inicio
K

Kakkonen

Para quienes no quieran instalar plugin, aqui les dejo un codigo php para que lo peguen en single.php antes del ID de los comentarios

Insertar CODE, HTML o PHP:
<?php
//for use in the loop, list 10 post titles related to first tag on current post
$backup = $post; // backup the current object
$tags = wp_get_post_tags($post->ID);
if ($tags) {
echo 'Entradas recomendadas';
$first_tag = $tags[0]->term_id;
$args=array(
'tag__in' => $tagIDs,
'post__not_in' => array($post->ID),
'showposts'=>10,
'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><a href="<?php the_permalink() ?>" rel="dofollow" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></p>
<?php
endwhile;
}
}
$post = $backup; // copy it back
wp_reset_query(); // to use the original query again
?>

espero mi dedo verde hehehehhe
 
abre el archivo single.php de tu theme y pegalo antes de los comentarios

Insertar CODE, HTML o PHP:
[B]<?php
//for use in the loop, list 10 post titles related to first tag on current post
$backup = $post; // backup the current object
$tags = wp_get_post_tags($post->ID);
if ($tags) {
echo 'Posicionamiento SEO Web en Google';
$first_tag = $tags[0]->term_id;
$args=array(
'tag__in' => $tagIDs,
'post__not_in' => array($post->ID),
'showposts'=>10,
'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><a href="<?php the_permalink() ?>" rel="dofollow" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></p>
<?php
endwhile;
}
}
$post = $backup; // copy it back
wp_reset_query(); // to use the original query again
?></strong>[/B]

    <div id="comments">
    <?php comments_template(); ?>
 
Rutamex y Abel muchas gracias! Yo me dedico a la redaccion, todo esto me cuesta ja.
Saludos.
 
Atrás
Arriba