astra_entry_header_class( bool $echo = true )
Astra entry header class
Description
Parameters
- $echo
-
(bool) (Optional) output being echoed or not.
Default value: true
Source
File: inc/markup-extras.php
function astra_entry_header_class() { $post_id = astra_get_post_id(); $classes = array(); $title_markup = astra_the_title( '', '', $post_id, false ); $thumb_markup = astra_get_post_thumbnail( '', '', false ); $post_meta_markup = astra_single_get_post_meta( '', '', false ); $blog_single_post_structure = astra_get_option( 'blog-single-post-structure' ); if ( ! $blog_single_post_structure || ( 'single-image' === astra_get_prop( $blog_single_post_structure, 0 ) && empty( $thumb_markup ) && 'single-title-meta' !== astra_get_prop( $blog_single_post_structure, 1 ) ) ) { $classes[] = 'ast-header-without-markup'; } elseif ( empty( $title_markup ) && empty( $thumb_markup ) && ( is_page() || empty( $post_meta_markup ) ) ) { $classes[] = 'ast-header-without-markup'; } else { if ( empty( $title_markup ) ) { $classes[] = 'ast-no-title'; } if ( empty( $thumb_markup ) ) { $classes[] = 'ast-no-thumbnail'; } if ( is_page() || empty( $post_meta_markup ) ) { $classes[] = 'ast-no-meta'; } } $classes = array_unique( apply_filters( 'astra_entry_header_class', $classes ) ); $classes = array_map( 'sanitize_html_class', $classes ); echo esc_attr( join( ' ', $classes ) ); }
Expand full source code Collapse full source code View on Trac
Changelog
Version | Description |
---|---|
1.0.15 | Introduced. |