Proper way to get page content

后端 未结 8 1682
不思量自难忘°
不思量自难忘° 2020-12-22 19:47

I have to get specific page content (like page(12))

I used that :

  post_content;  ?>


        
相关标签:
8条回答
  • 2020-12-22 20:32

    One liner:

    <? if (have_posts()):while(have_posts()): the_post(); the_content(); endwhile; endif; ?>
    
    0 讨论(0)
  • 2020-12-22 20:33

    I've answered my own question. Call apply_filter and there you go.

    <?php 
    $id=47; 
    $post = get_post($id); 
    $content = apply_filters('the_content', $post->post_content); 
    echo $content;  
    ?>
    
    0 讨论(0)
提交回复
热议问题