get page title 2c excerpt or content by id

Solutions on MaxInterview for get page title 2c excerpt or content by id by the best coders in the world

showing results for - "get page title 2c excerpt or content by id"
Jonathan
26 Jan 2018
1<?php 
2$var_name = get_post('1'); // here 1 is id of the page.
3
4echo $page_title = $var_name->post_title;
5
6echo $page_excerpt = $var_name->post_excerpt;
7
8echo $page_content = $var_name->post_content;
9?>
Caterina
28 Jul 2019
1<?php 
2$page_name = get_page_by_title( 'About' ); // here About is page name.
3
4
5echo $page_title = $page_name->post_title;
6
7echo $page_excerpt = $page_name->post_excerpt;
8
9echo $page_content = $page_name->post_content;
10?>