0

いくつかのページを次のようなコンテンツスライダーにレンダリングします。

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

私が作成したすべてのショートコードは魅力のように機能しますが、gallery-shortcodeは無視されます(ショートコードではなく、空ではなく<p>、何も返さない...)

助けていただければ幸いです、ありがとう

4

1 に答える 1

0

わかりました...変数でのみ機能し$postます:

$post    = get_page( $postID );
$content = apply_filters('the_content', $post->post_content);
于 2012-03-02T15:22:21.397 に答える