get page title 2c excerpt or content by name of the page

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

showing results for - "get page title 2c excerpt or content by name of the page"
Luca
07 May 2020
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?>
Andrea
30 Jan 2017
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?>