wordpress get particular page content programmatically

Solutions on MaxInterview for wordpress get particular page content programmatically by the best coders in the world

showing results for - "wordpress get particular page content programmatically"
Karolina
20 Sep 2020
1<?php 
2$id=47; 
3$post = get_post($id); 
4$content = apply_filters('the_content', $post->post_content); 
5echo $content;  
6?>
Alessandro
10 Jan 2021
1<?php
2
3// would echo post 7's content up until the <!--more--> tag
4$post_7 = get_post(7); 
5$excerpt = $post_7->post_excerpt;
6echo $excerpt;
7
8// would get post 12's entire content after which you
9// can manipulate it with your own trimming preferences
10$post_12 = get_post(12); 
11$trim_me = $post_12->post_content;
12my_trim_function( $trim_me );
13
14?>