WordPress: How do i put a shortcode inside a shortcode?

I am having an issue adding this shortcode as there are shortcodes within the shortcode as well (nested shortcodes). The parent shortcode works fine. But the ones that should come in the content are not. I am using the Tabs shortcode and widget.

Link: Tabs Shortcode and Widget Plugin

Read More

Within each tab content, I have included a unite gallery shortcode, but they are not reflecting on the site.

I will post my entire shortcode below:

<?php echo do_shortcode('[otw_shortcode_tabslayout tabs="3" tab_1_title="Bags" tab_1_content="[unitegallery bags catid=1]" tab_2_title="Wallets" tab_2_content="[unitegallery wallets catid=2]" tab_3_title="Clutches" tab_3_content="[unitegallery clutches catid=3]"][/otw_shortcode_tabslayout]'); ?>

Any help will be greatly appreciated.

Related posts

2 comments

  1. To enable Shortcode as parameter to another shortcode, try to change square bracket [] to curly bracket {} as below.

    echo do_shortcode('[otw_shortcode_tabslayout tabs="3" tab_1_title="Bags" tab_1_content="{unitegallery bags catid=1}" tab_2_title="Wallets" tab_2_content="{unitegallery wallets catid=2}" tab_3_title="Clutches" tab_3_content="{unitegallery clutches catid=3}"][/otw_shortcode_tabslayout]');
    
  2. Instead of this

    <?php echo do_shortcode('[otw_shortcode_tabslayout tabs="3" tab_1_title="Bags" tab_1_content="[unitegallery bags catid=1]" tab_2_title="Wallets" tab_2_content="[unitegallery wallets catid=2]" tab_3_title="Clutches" tab_3_content="[unitegallery clutches catid=3]"][/otw_shortcode_tabslayout]'); ?>
    

    Try to do echo do_shortcode([unitegallery bags catid=1]) where this tab_1_content parameter is being echoed

Comments are closed.