get_the_title() is a WordPress function that returns the title of the current post or a specified post. Here’s how you can use it:

  1. To get the title of the current post:
php
<?php echo get_the_title(); ?>
  1. To get the title of a specific post by post ID:
php
<?php echo get_the_title( $post_id ); ?>

Replace $post_id with the ID of the post you want to get the title of.

  1. To get the title of a specific post by post object:
php
<?php $post_object = get_post( $post_id );
echo get_the_title( $post_object ); ?>

Replace $post_id with the ID of the post you want to get the title of. In this case, get_post() function is used to get the post object.

Note: These code examples should be used within the WordPress loop, otherwise the function will not work correctly.