在返回函数中添加php短代码
我有这部分代码:在返回函数中添加php短代码,php,wordpress,function,shortcode,Php,Wordpress,Function,Shortcode,我有这部分代码: return '<img class="myimage '.$text_color.' '.$horizontal.$slide_fitscreen.'" src="'.$image.'" alt="" '.$slide_desc.' />'; 返回“”; 我想做的是返回一个php短代码,但不在内,因为我的短代码生成一个元素,所以我需要在img之后返回它 这是我的短码: <?php echo do_shortcode('[gallery]'); ?>
return '<img class="myimage '.$text_color.' '.$horizontal.$slide_fitscreen.'" src="'.$image.'" alt="" '.$slide_desc.' />';
返回“”;
我想做的是返回一个php短代码,但不在
内,因为我的短代码生成一个
元素,所以我需要在img之后返回它
这是我的短码:
<?php echo do_shortcode('[gallery]'); ?>
我怎么做这个
谢谢 你是说:
return '<img class="myimage '.$text_color.' '.$horizontal.$slide_fitscreen.'" src="'.$image.'" alt="" '.$slide_desc.' />'.do_shortcode('[gallery]');
返回“”。不使用短代码(“[gallery]”);
你是说:
return '<img class="myimage '.$text_color.' '.$horizontal.$slide_fitscreen.'" src="'.$image.'" alt="" '.$slide_desc.' />'.do_shortcode('[gallery]');
返回“”。不使用短代码(“[gallery]”);
对我来说不是很有用。我收到类似这样的消息:Error(Parseerror):语法错误意外标记对我来说不起作用。我收到如下消息:Error(Parseerror):语法错误意外标记