gracias por el articulo. la duda que me queda es donde pego el codigo siguiente que viene en el tuto?
Si en vez de tener en cuneta los tags, queréis el listado utilizando las categorías a las que pertenece el post entonces el código sería el siguiente:
1 <?php
2
3 $orig_post = $post;
4 global $post;
5 $categories = get_the_category($post->ID);
6 if ($categories) {
7 $category_ids = array();
8 foreach($categories as $individual_category) $category_ids[] = $individual_category->term_id;
9
10 $args=array(
11 'category__in' => $category_ids,
12 'post__not_in' => array($post->ID),
13 'posts_per_page'=> 4, // número de post a mostrar
14 'caller_get_posts'=>1
15 );
16
17 $my_query = new wp_query( $args );
18 if( $my_query->have_posts() ) {
19 echo '<div id="related_posts"><h3>Post Relacionados</h3><ul>';
20 while( $my_query->have_posts() ) {
21 $my_query->the_post();?>
22
23 <li><div><a href="<? the_permalink()?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_post_thumbnail(); ?></a></div>
24 <div>
25 <h3><a href="<? the_permalink()?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3>
26 </div>
27 </li>
28 <?
29 }
30 echo '</ul></div>';
31 }
32 }
33 $post = $orig_post;
34 wp_reset_query(); ?>