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

I have created an enclosing shortcode that is styled to be a button with the intention of putting content in it. I am echoing this shortcode inside a theme file and want the content to link to a specific relative page. However, I am not using the proper quotations and can't seem to figure this rudimentary php syntax out.

<?php echo do_shortcode('[apply]<a href="<?php echo site_url(); ?>/quick-quote">Quick Quote</a>[/apply]'); ?> 

I know this is wrong. Just looking for some guidance.

share|improve this question
up vote 4 down vote accepted
<?php echo do_shortcode("[apply]<a href='" . site_url() . "/quick-quote'>Quick Quote</a>[/apply]"); ?> 
share|improve this answer
perfect. thanks! am I concatenating because it's already in php? – chris_s Feb 16 '12 at 20:19
@chris_s bingo. You might actually want to use site_url( '/quick-quote/' ); instead...it's a bit neater – mor7ifer Feb 17 '12 at 2:36

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.