WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How would I show posts that have a tag who's name matches the title of the current post? For example if you are on a post called "Hippo" at the bottom of the page I would like posts with the tag "Hippo" to be displayed.

share|improve this question
up vote 1 down vote accepted

The query would look something like this:

$title_tagged_posts_query = new WP_Query( array(
    'tag' => strtolower( get_the_title() )
) );

while ( $title_tagged_posts_query->have_posts() ) : $title_tagged_posts_query->the_post();
    //Output whatever you want here.

This assumes that the tag slug for "Hippo" is "hippo", which should normally be the case.

share|improve this answer
Thanks but I'm having a heard time getting it to output content. Does it work similar to a querypost? for example where you have the comment I put echo get_post_meta($post->ID,'videoembed',true) ; and I get nothing output. – Sam Jun 22 '12 at 23:01
It should work similarly - have you make sure to declare $post as a global? (global $post). As an alternative, you could use the get_the_ID() function: get_post_meta( get_the_ID(), 'videoembed', true ); – Andy Adams Jun 22 '12 at 23:06

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.