다음은 사용중인 코드입니다. 나는 몇 가지 시도했지만 그들 중 누구도 일하지 않았다. 어떤 아이디어?루프 외부의 특정 ID에서 콘텐츠 및 메타 데이터를로드하는 방법
<?php
$id = 29;
$post = get_post($id);
$title = apply_filters('get_the_title', $post->post_title);
$content = apply_filters('the_content', $post->post_content);
$meta = get_post_meta($id, 'example_meta', true);
echo "<h4 class='col-12'>", $title, "</h4>";
echo "<h2 class='col-12 col-md-11 col-lg-8 py-5'>", get_the_subtitle($post), "</h2>";
echo $content;
echo $meta;
?>
무엇이 문제입니까, 무엇을하려하십니까? – madalinivascu
"get_the_subtitle"이 WorPress의 핵심 기능인지 확실하지 않습니다. 당신이 그것을 만들지 않는 한. –
@ FazleElahee 당신 말이 맞아요. 플러그인을 사용하고 있습니다. "WP 자막"이라고합니다. https://wordpress.org/plugins/wp-subtitle/ – neongrain