title: How do I Echo a variable in html?
body: <p>I'm trying to include a variable within some existing code but my PHP skills are quite basic. I've looked around and can;t find anything I can reaidly apply as a fix for this although I'm sure it's pretty simple.</p>
  
  <p>The original code is:</p>
  
  <pre><code>&lt;p class="ad-price"&gt;&lt;?php if(get_post_meta($post-&gt;ID, 'price', true)) cp_get_price_legacy($post-&gt;ID); else cp_get_price($post-&gt;ID); ?&gt;&lt;/p&gt;
  </code></pre>
  
  <p>and the code I'm trying to change it to (and think should be working) is:</p>
  
  <pre><code>&lt;?php $yourtext = get_post_meta($post-&gt;ID, 'cp_pricing_period', TRUE); 
  echo "&lt;p class="ad-price"&gt;&lt;?php if(get_post_meta($post-&gt;ID, 'price', true)) cp_get_price_legacy($post-&gt;ID); else cp_get_price($post-&gt;ID); ?&gt; $yourtext&lt;/p&gt;"; ?&gt;
  </code></pre>
  
  <p>These changes are obviously wrong because it stops the whole file working. Can anyone shed light on where I'm getting this wrong?</p>
  
  <p>Thanks</p>