Use get_the_title()
:
$page = get_page_by_title( 'About' );
$title = get_the_title( $page );
You could also use $page->post_title
, but get_the_title()
will let plugins access the title, which sometimes quite useful.
Use get_the_title()
:
$page = get_page_by_title( 'About' );
$title = get_the_title( $page );
You could also use $page->post_title
, but get_the_title()
will let plugins access the title, which sometimes quite useful.