How to add another header?

How to add header code below

<div class="container">
<?php
 $header_1 = get_post_meta( $post->ID, 'header-1', true );
 $header_2 = get_post_meta( $post->ID, 'header-2', true );
?>
 <?php if($header_1): ?><h1 class="header__title"><?= $header_1 ?></h1><?php endif; ?>
 <?php if($header_2): ?><p class="header__subtitle"><span class="title-text"><?= $header_2 ?></span></p><?php endif; ?>
April 19th 20 at 12:24
2 answers
April 19th 20 at 12:26
tricky question) ? if to continue a logic number, then 1,2,3...
April 19th 20 at 12:28
$n = 1;
while ( $n <= 3 ) {
 $header = get_post_meta( $post->ID, 'header-' . $n, true );
 if ( ! empty( $header ) ) {
 echo $header;
}
 $n ++;
}
Below the insert? - Enrico_Volkman44 commented on April 19th 20 at 12:31
@Enrico_Volkman44instead - yessenia90 commented on April 19th 20 at 12:34

Find more questions by tags WordPress