Support » Plugins and Hacks » Integrating Template Tags in Plugins
9 years, 11 months ago
I want to use several template tags in my new plugin, but I’m having problems. I thought this would be a way to do it.
echo "comments_popup_link('No Comments', 'Comments (1)', 'Comments (%)');";
But that just prints the text and doesn’t run the function. How would I do this? Do I need to set a variable and concatenate it?
9 years, 10 months ago
You need to surround the template tags in <?php ?> tags. Like so:
echo “<?php comments_popup_link(‘No Comments’, ‘Comments (1)’, ‘Comments (%)’); ?>”;
I appreciate the response, but that’s not working. I’m getting the following error:
Parse error: parse error, unexpected $end
I’m trying to use the template tag in a plugin inside a function. (If that makes a difference.)