Skip to content

Instantly share code, notes, and snippets.

@premanshup
Last active January 8, 2020 14:12
Show Gist options
  • Save premanshup/74175b5e1b78ba721c139102e9a523a3 to your computer and use it in GitHub Desktop.
Save premanshup/74175b5e1b78ba721c139102e9a523a3 to your computer and use it in GitHub Desktop.
Astra WordPress Theme Description <p> tag missing.
/**
* Archive Page Title
*/
if ( ! function_exists( 'astra_archive_page_info' ) ) {
/**
* Wrapper function for the_title()
*
* Displays title only if the page title bar is disabled.
*/
function astra_archive_page_info() {
if ( apply_filters( 'astra_the_title_enabled', true ) ) {
// Author.
if ( is_author() ) { ?>
<section class="ast-author-box ast-archive-description">
<div class="ast-author-bio">
<?php do_action( 'astra_before_archive_title' ); ?>
<h1 class='page-title ast-archive-title'><?php echo get_the_author(); ?></h1>
<?php do_action( 'astra_after_archive_title' ); ?>
<p><?php echo wp_kses_post( get_the_author_meta( 'description' ) ); ?></p>
<?php do_action( 'astra_after_archive_description' ); ?>
</div>
<div class="ast-author-avatar">
<?php echo get_avatar( get_the_author_meta( 'email' ), 120 ); ?>
</div>
</section>
<?php
// Category.
} elseif ( is_category() ) {
?>
<section class="ast-archive-description">
<?php do_action( 'astra_before_archive_title' ); ?>
<h1 class="page-title ast-archive-title"><?php echo single_cat_title(); ?></h1>
<?php do_action( 'astra_after_archive_title' ); ?>
<?php echo wp_kses_post( wpautop( get_the_archive_description() ) ); ?>
<?php do_action( 'astra_after_archive_description' ); ?>
</section>
<?php
// Tag.
} elseif ( is_tag() ) {
?>
<section class="ast-archive-description">
<?php do_action( 'astra_before_archive_title' ); ?>
<h1 class="page-title ast-archive-title"><?php echo single_tag_title(); ?></h1>
<?php do_action( 'astra_after_archive_title' ); ?>
<?php echo wp_kses_post( wpautop( get_the_archive_description() ) ); ?>
<?php do_action( 'astra_after_archive_description' ); ?>
</section>
<?php
// Search.
} elseif ( is_search() ) {
?>
<section class="ast-archive-description">
<?php do_action( 'astra_before_archive_title' ); ?>
<?php
/* translators: 1: search string */
$title = apply_filters( 'astra_the_search_page_title', sprintf( __( 'Search Results for: %s', 'astra' ), '<span>' . get_search_query() . '</span>' ) );
?>
<h1 class="page-title ast-archive-title"> <?php echo $title; ?> </h1>
<?php do_action( 'astra_after_archive_title' ); ?>
</section>
<?php
// Other.
} else {
?>
<section class="ast-archive-description">
<?php do_action( 'astra_before_archive_title' ); ?>
<?php the_archive_title( '<h1 class="page-title ast-archive-title">', '</h1>' ); ?>
<?php do_action( 'astra_after_archive_title' ); ?>
<?php echo wp_kses_post( wpautop( get_the_archive_description() ) ); ?>
<?php do_action( 'astra_after_archive_description' ); ?>
</section>
<?php
}
}
}
add_action( 'astra_archive_header', 'astra_archive_page_info' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment