Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/13.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 嵌套短代码不工作(第二级嵌套) [行] [列大小=“八”] [row]你好世界[/row] [行]类别:网络/创作/交互设计[/row] [/列] [column size=“four”]在此处插入内容[/column] [/世界其他地区]_Php_Wordpress_Shortcode - Fatal编程技术网

Php 嵌套短代码不工作(第二级嵌套) [行] [列大小=“八”] [row]你好世界[/row] [行]类别:网络/创作/交互设计[/row] [/列] [column size=“four”]在此处插入内容[/column] [/世界其他地区]

Php 嵌套短代码不工作(第二级嵌套) [行] [列大小=“八”] [row]你好世界[/row] [行]类别:网络/创作/交互设计[/row] [/列] [column size=“four”]在此处插入内容[/column] [/世界其他地区],php,wordpress,shortcode,Php,Wordpress,Shortcode,这是我使用的短代码。但是由于某种原因,[row]…[/row]短代码似乎不起作用。 以下是短码函数: [row] [column size="eight"] [row]<h5>HELLO<strong>WORLD</strong></h5>[/row] [row]<h5>CATEGORIES: <strong>WEB / CREATIONS / INTERACTIVE DESIGN</strong>

这是我使用的短代码。但是由于某种原因,[row]…[/row]短代码似乎不起作用。 以下是短码函数:

[row]
[column size="eight"]
    [row]<h5>HELLO<strong>WORLD</strong></h5>[/row]
    [row]<h5>CATEGORIES: <strong>WEB / CREATIONS / INTERACTIVE DESIGN</strong></h5>[/row]
[/column]
[column size="four"]Insert your content here[/column]
[/row]
function su\u column\u短码($atts,$content=null){
提取(短码)附件(数组)(
“大小”=>“六”
)美元(附件);;
返回“”。su_do_短代码($content,'c')。';
}
函数su_行_短代码($atta=null,$content=null){
返回“”。su_do_短代码($content,'r')。';
}

你所描述的不是一个问题,而是一个事实

不能嵌套Wordpress短代码。如果需要嵌套,则需要自己进行“嵌套”,方法是在自己的短代码内部的“内部”部分应用所有短代码


请参见

谢谢hakre!不知道。当然一个人不可能知道一切,也考虑一些谷歌搜索。codex通常有关于wordpress功能的有用信息,因此值得阅读和搜索(在搜索词中添加“codex”)。
function su_column_shortcode( $atts, $content = null ) {
    extract( shortcode_atts( array(
            'size' => 'six'
            ), $atts ) );
    return '<div class="' . $size . ' columns">' . su_do_shortcode( $content, 'c' ) . '</div>';
}
function su_row_shortcode($atta = null, $content = null ) {
    return '<div class="row">'.su_do_shortcode( $content, 'r').'</div>';
}