Only display archive subtitle on the first archive page
I would like to only display the archive subtitle on the first archive page. Now, it shows at the top of every page.
To help understand what I am doing I’ll tell a bit more. I am putting a lot of information with direct links in the subtitle of the tags (it’s actually a custom taxonomy if that matters). So basically the first archive page will give the user possibly all the information and specific links to posts that they may need. However, the archive pages will provide a comprehensive way to find all the content that may have that tag.
Currently, index.php seems to be what is generating my archive pages.
I’m guessing this is the part I need to modify:
if ( $archive_title || $archive_subtitle ) {
?>
<header class="archive-header has-text-align-center header-footer-group">
<div class="archive-header-inner section-inner medium">
<?php if ( $archive_title ) { ?>
<h1 class="archive-title"><?php echo wp_kses_post( $archive_title ); ?></h1>
<?php } ?>
<?php if ( $archive_subtitle ) { ?>
<div class="archive-subtitle section-inner thin max-percentage intro-text"><?php echo wp_kses_post( wpautop( $archive_subtitle ) ); ?></div>
<?php } ?>
<hr class="archive-head-separator styled-separator">
</div><!-- .archive-header-inner -->
</header><!-- .archive-header -->
<?php
}
Is there a way to know what page of the archive it’s on and somehow work that into an if statement around this bit?
<?php if ( $archive_subtitle ) { ?>
<div class="archive-subtitle section-inner thin max-percentage intro-text"><?php echo wp_kses_post( wpautop( $archive_subtitle ) ); ?>
Thanks!
Leave an answer