Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/284.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在返回函数中添加php短代码_Php_Wordpress_Function_Shortcode - Fatal编程技术网

在返回函数中添加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):语法错误意外标记