Proper way to get page content

后端 未结 8 1891
不思量自难忘°
不思量自难忘° 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:19

    The wp_trim_words function can limit the characters too by changing the $num_words variable. For anyone who might find useful.

    post_content); 
    
    $customExcerpt = wp_trim_words( $content, $num_words = 26, $more = '' );
    echo $customExcerpt;  
    ?>
    

提交回复
热议问题