title: How to echo out a php variable into an html link in a wordpress shortcode
body: <p>In my short code I am dynamically grabbing some custom posts and displaying them.  These custom posts have a custom field labeled 'url'.  What I'm trying to do is grab the value from that custom field and put it in the href of an anchor tag.  The problem is that I can't seem to use echo in a shortcode.  It seems that the function do_shortcode might be the answer, but I am not sure how to use it in my case.  The problem is in this line:</p>
  
  <pre><code>$retour .= "&lt;a href='".echo $meta_values;."'&gt;";
  </code></pre>
  
  <p>Here is the rest of the code for the shortcode</p>
  
  <pre><code>function sc_liste($atts, $content = null) {
      extract(shortcode_atts(array(
              "cat" =&gt; ''
      ), $atts));
      global $post;
  
      $myposts = get_posts('post_type=section_modules&amp;category_name='.$cat.'&amp;order=ASC');
      $retour = "&lt;div class='container-fluid sectionBoxContainer'&gt;&lt;div class='row-fluid'&gt;";
      foreach($myposts as $post) :
      $meta_values = get_post_meta( $post-&gt;ID, 'url', true );
           $retour .= "&lt;a href='".echo do_shortcode();."'&gt;";
           $retour.="&lt;div class='sectionBox span4'&gt;&lt;h2&gt;".$post-&gt;post_title."&lt;/h2&gt;&lt;div class='hrule_black'&gt;&lt;/div&gt;&lt;p&gt;".$post-&gt;post_content."&lt;/p&gt;&lt;/div&gt;";
           $retour .="&lt;/a&gt;";
      endforeach;
      $retour .= "&lt;/div&gt;&lt;/div&gt;";
  
      return $retour;
  
  
  }
  </code></pre>