Title: How To Add Comments Function Inside Shortcode In Theme
Last modified: August 20, 2016

---

# How To Add Comments Function Inside Shortcode In Theme

 *  [woood77](https://wordpress.org/support/users/woood77/)
 * (@woood77)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/how-to-add-comments-function-inside-shortcode-in-theme/)
 * Hello,
 * I’m trying add the comments area of my posts to a tab by using a tab plugin.
 * I’m using the following code which was provided by the plugin developer in my
   template file to accomplish this, but I can seem to figure out how to add a function
   inside this shortcode code.
 *     ```
       <?php
       do_shortcode("[tab name='Tab 1']{$content}[/tab]");
       do_shortcode("[tab name='Tab 2']{$serviceInfo}[/tab]");
       do_shortcode("[tab name='Tab 3']Condolences Here[/tab]");
       echo do_shortcode('[end_tabset]');
       ?>
       ```
   
 * The 3rd line is giving me the trouble. Instead of “Condolences Here” I’d like
   to add the comments_template() function to the 3rd line so my comments appear
   on the 3rd tab. However it doesn’t work. I want it to look something like this:
 * `do_shortcode("[tab name='Tab 3']comments_template()[/tab]");`
 * I can’t figure out how to allow this php function inside the do_shortcode function.
 * Thanks for the help!

The topic ‘How To Add Comments Function Inside Shortcode In Theme’ is closed to 
new replies.

## Tags

 * [do_shortcode](https://wordpress.org/support/topic-tag/do_shortcode/)
 * [function](https://wordpress.org/support/topic-tag/function/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [woood77](https://wordpress.org/support/users/woood77/)
 * Last activity: [13 years, 11 months ago](https://wordpress.org/support/topic/how-to-add-comments-function-inside-shortcode-in-theme/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
