我在添加此短代码时遇到问题,因为短代码中也有短代码(嵌套短代码)。父简码工作正常。但那些应该出现在内容中的却没有。我正在使用选项卡短代码和小部件。
链接:Tabs Shortcode and Widget Plugin
在每个选项卡内容中,我都包含了一个统一画廊短代码,但它们没有反射(reflect)在网站上。
我将在下面发布我的整个短代码:
<?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]'); ?>
任何帮助将不胜感激。
最佳答案
要启用短代码作为另一个短代码的参数,请尝试将方括号[]更改为大括号{},如下所示。
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]');
关于tabs - WordPress:如何将短代码放入短代码中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34651068/