// Mostrar artículos similares después del contenido del post function mostrar_articulos_similares_por_etiqueta() { if (is_single()) { $tags = wp_get_post_tags(get_the_ID()); if ($tags) { $tag_ids = array(); foreach ($tags as $tag) { $tag_ids[] = $tag->term_id; } $args = array( 'tag__in' => $tag_ids, 'post__not_in' => array(get_the_ID()), 'posts_per_page' => 12, 'orderby' => 'date', 'order' => 'DESC' ); $related_posts = new WP_Query($args); if ($related_posts->have_posts()) { echo '