Conditionals if tags exist?
Try this <?php $related = new WP_Query( ‘tag=’ . get_the_title() . ” ); if( $related->have_posts() ): <h1>Related Articles</h1> while ( $related->have_posts() ) : the_post(); ?> <li><a href=”https://wordpress.stackexchange.com/questions/48774/<?php the_permalink() ?>”><?php the_title(); ?></a> </li> <?php endwhile; else: //there are no related articled endif; wp_reset_postdata();?> EDIT You should not use query_posts for a secondary loop. The query_posts alters … Read more