get_the_archive_description example



get_header();

$description = get_the_archive_description();
?> <?php if ( have_posts() ) : ?> <header class="page-header alignwide"> <?php the_archive_title( '<h1 class="page-title">', '</h1>' ); ?> <?php if ( $description ) : ?> <div class="archive-description"><?php echo wp_kses_post( wpautop( $description ) ); ?></div> <?php endif; ?> </header><!-- .page-header -->
/** * Displays category, tag, term, or author description. * * @since 4.1.0 * * @see get_the_archive_description() * * @param string $before Optional. Content to prepend to the description. Default empty. * @param string $after Optional. Content to append to the description. Default empty. */
function the_archive_description( $before = '', $after = '' ) {
    $description = get_the_archive_description();
    if ( $description ) {
        echo $before . $description . $after;
    }
}

/** * Retrieves the description for an author, post type, or term archive. * * @since 4.1.0 * @since 4.7.0 Added support for author archives. * @since 4.9.0 Added support for post type archives. * * @see term_description() * * @return string Archive description. */
Home | Imprint | This part of the site doesn't use cookies.