how to get the current post title in wp code example
Example 1: wordpress echo the page title
<?php echo get_the_title(post->$ID); ?>
Example 2: get post title by post id wordpress
get_post( $post_id )->post_title
<?php echo get_the_title(post->$ID); ?>
get_post( $post_id )->post_title