I've got this shortcode in my functions.php:
function amaranthe_buy_tickets( $atts, $content = null ) {
extract(shortcode_atts(array(
'link' => '#',
'target' => '',
'variation' => '',
'size' => '',
'align' => '',
), $atts));
$style = ($variation) ? ' '.$variation. '_gradient' : '';
$align = ($align) ? ' align'.$align : '';
$size = ($size == 'large') ? ' large_button' : '';
$target = ($target == 'blank') ? ' target="_blank"' : '';
$out = '<a' .$target. ' class="tickets_btn' .$style.$size.$align. '" href="' .$link. '">' .$content. '</a>';
return $out;
}
add_shortcode('buy-tickets', 'amaranthe_buy_tickets');
In my template file where I want the shortcode to display, I have this:
<?php echo do_shortcode("[buy-tickets]"); ?>
and in the post, I have this:
[buy-tickets]Tickets[/buy-tickets]
In the output, all I get is this:
<a href="#" class="tickets_btn"></a>
For some reason, the content is missing.
hrefcomes afterclass). Please add the real output, do not use the DOM inspector, use source view instead. – toscho♦ Jan 11 at 5:37