Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/5.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
Wordpress gallery短代码和获取页面_Wordpress_Shortcode - Fatal编程技术网

Wordpress gallery短代码和获取页面

Wordpress gallery短代码和获取页面,wordpress,shortcode,Wordpress,Shortcode,我将一些页面渲染到内容滑块,如下所示: function tonal_get_slide($postID) { $page_data = get_page( $postID ); $title = $page_data->post_title; $content = "<h2>" . $title . "</h2>"; $content .= apply_filters('the_content', $page_data->po

我将一些页面渲染到内容滑块,如下所示:

function tonal_get_slide($postID) {
    $page_data = get_page( $postID );
    $title = $page_data->post_title;
    $content = "<h2>" . $title . "</h2>";
    $content .= apply_filters('the_content', $page_data->post_content);
    return $content;
}
function tonal\u get\u幻灯片($postID){
$page\u data=get\u page($posted);
$title=$page\u data->post\u title;
$content=“”.$title。”;
$content.=apply_filters('the_content',$page_data->post_content);
返回$content;
}
我自己创建的所有短代码都像一个符咒一样工作,但是gallery短代码被忽略了(它不返回任何内容,而不是短代码,没有空的
,没有任何内容…)

如果您有任何帮助,我们将不胜感激, 谢谢

明白了。。。 仅适用于
$post
变量:

$post    = get_page( $postID );
$content = apply_filters('the_content', $post->post_content);