This task is relevant for cases when developers in custom templates for some reason decide not to display the page title, although according to all SEO requirements it should be, and should be wrapped in h1.
Heading Examples
1. In the page template:
in the page.php of your theme, add the following construction:
<?php echo '<h1>'. esc_html( get_the_title() ) .'</h1>'; ?>
2. In the post template:
in the file single.php or content-single.php add the same code:
<?php echo '<h1>'. esc_html( get_the_title() ) .'</h1>'; ?>
3. In the categories template (post archives):
in the file archive.php add this code:
<?php the_archive_title( '<h1 class="page-title">', '</h1>' ); ?>