2017-02-06 1 views
0

저는 WordPress에 상당히 익숙하며 게시물 본문을 얻으려고합니다. 사용하고이 주제처럼 그 일을하고하는 것은 그들이 getiing 게시물 본문을 받고 있지 않다이 같은 방법을 사용하여이WordPress에 게시 본문을 가져 오려고했지만 작동하지 않습니다.

$plan_featured_ads = get_post_meta($post->ID, 'featured_ads', true); 

같은 메타가 게시 classiad있다가

$post_content = get_post_field($post->ID, 'post_content'); 

이 아무 것도 반환하지 않습니다, 무엇을 내가 잘못하고있는거야?

답변

1

이미 $postWP_Post의 인스턴스를 가지고처럼이 때문에이 post_content 다음 작업을 수행 할 수 있습니다에 액세스하려면 같습니다

// If you need an un-filtered version of the post: 
$post->post_content; 

// If you need a filtered version of the post for displaying on screen: 
apply_filters('the_content', $post->post_content); 
관련 문제