将数组数据传递给循环中的变量

How do I pass the contents of the $the_slug to the $post_name variable in the loop?

$tags = get_the_tags();
foreach ($tags as $tag){

global $post;
$the_slug = $tag->slug; //contains 10ish words that associate with my permalinks: welcome, home, about, contact, etc

$post_id = 'welcome';
$post_name = $the_slug; //fails to populate here
$queried_post = get_post($post_name); //if changed to $post_id works but only 'welcome' post
$excerpt = $queried_post->post_excerpt;
$excerpt = apply_filters('the_content', $excerpt);
$excerpt = str_replace(']]>', ']]>', $excerpt);
echo $excerpt . "

";
}

Thanx for looking.

You can iterate over the array with a foreach loop:

foreach($the_slug as $slug){
   $post_name = $slug;
   $queried_post = get_post($post_name); $excerpt = $queried_post->post_excerpt;
   $excerpt = apply_filters('the_content', $excerpt);
   $excerpt = str_replace(']]>', ']]>', $excerpt);
   echo $excerpt . "

";
}