I have to get specific page content (like page(12))
I used that :
<?php $id=47; $post = get_page($id); echo $post->post_content; ?>
Work nice execpt for compatibility with translations, it returns both French and English text
But the loop is fine, return only the good language version
<?php if(have_posts()) : while(have_posts()) : the_post(); ?>
<div id="post">
<?php the_content(); ?>
</div> <!-- .post -->
So the question…. HOW to get a specific page content inside the loop…
I’ve answered my own question. Call
apply_filter
and there you go.get page content by page name:
I used this:
and this even more concise:
A simple, fast way to get the content by id :
And if you want to get the content formatted :
Works with pages, posts & custom posts.
Just only copy and paste this code it will get your page content.
The wp_trim_words function can limit the characters too by changing the $num_words variable. For anyone who might find useful.
//if you want specific page of content then write in loop
One liner: