dimanche 8 mars 2015

How to use an if else statement in the middle of an echo

I get Parse error: syntax error, unexpected 'if' (T_IF), expecting ',' or ';' in which is for this line if ($meta == '') . Can someone provide a bit of guidance please, so that my if else statement works in this echo? Thank-you!!!



echo '<tr>
<th><label for="twitter_embed">Twitter Embed</label></th>
<td><textarea name="twitter_embed" id="twitter_embed" cols="60" rows="4">'
if ($meta == '')
{ get_option('my_option_name');
}else{
.$meta. ;
}'</textarea>
<span class="description">Use to embed tweets on your post.</span></td>
</tr>';

echo '</table>';
}


the get_option is for wordpress . Please can someone help with this if - else statement inside an echo?


Aucun commentaire:

Enregistrer un commentaire