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);