Getting shortcode in template files to work
-
I’m trying to add external product links within my theme’s template files. The do_shortcode function works on the basic ‘internal’ link, so the following code works just fine:
echo do_shortcode( '[product_link]' );
But I just can’t seem to get the external attribute to work:
echo do_shortcode( '[product_link external=true]' );
I’ve tried it with or without quotes, and putting the attribute value into a variable, but it still doesn’t show up. Any ideas?
Perhaps I should avoid shortcodes altogether, and just pull the URL from the custom field (in which case, could anyone help me with the correct name)?
I can’t put a link up, as I’m testing it on localhost for now.
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Getting shortcode in template files to work’ is closed to new replies.