astra_get_archive_description( string $post_type )

Get the current archive description.


Description


Parameters

$post_type

(string) (Required) post type.


Return

(string) $description Description for archive.


Source

File: inc/blog/blog.php

function astra_get_archive_description( $post_type ) {
	$description = '';
	if ( ! is_search() ) {
		if ( ! empty( get_the_archive_description() ) ) {
			$description = get_the_archive_description();
		}
		if ( is_author() ) {
			if ( ! empty( trim( get_the_author_meta( 'description' ) ) ) ) {
				$description = get_the_author_meta( 'description' );
			}
		}
		if ( empty( $description ) && ! have_posts() ) {
			$description = esc_html( astra_default_strings( 'string-content-nothing-found-message', false ) );
		}
	}
	if ( is_post_type_archive( $post_type ) ) {
		$description = astra_get_option( 'ast-dynamic-archive-' . $post_type . '-custom-description', '' );
	}
	if ( 'post' === $post_type && ( ( is_front_page() && is_home() ) || is_home() ) ) {
		$description = astra_get_option( 'ast-dynamic-archive-post-custom-description', '' );
	}
	return $description;
}

Changelog

Changelog
Version Description
4.0.0 Introduced.


User Contributed Notes

You must log in before being able to contribute a note or feedback.