= 2 && ! bizznis_a11y() ) { return; } # Stop here if there's no term, or no term meta set $term = is_tax() ? get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) ) : get_queried_object(); if ( ! $term || ! isset( $term->meta ) ) { return; } $headline = $intro_text = ''; if ( $term->meta['headline'] ) { $headline = sprintf( '

%s

', strip_tags( $term->meta['headline'] ) ); } else { if ( bizznis_a11y() ) { $headline = sprintf( '

%s

', strip_tags( $term->name ) ); } } if ( $term->meta['intro_text'] ) { $intro_text = apply_filters( 'bizznis_term_intro_text_output', $term->meta['intro_text'] ); } if ( $headline || $intro_text ) { printf( '
%s
', $headline . $intro_text ); } } endif; add_filter( 'bizznis_author_intro_text_output', 'wpautop' ); add_action( 'bizznis_loop', 'bizznis_do_author_title_description', 5 ); /** * Add custom headline and description to author archive pages. * * @since 1.0.0 */ if ( ! function_exists( 'bizznis_do_author_title_description' ) ) : function bizznis_do_author_title_description() { # Stop here if we're not on an author archive page if ( ! is_author() ) { return; } # Stop here if we're not on page 1 if ( get_query_var( 'paged' ) >= 2 && ! bizznis_a11y() ) { return; } # If there's a custom headline to display, it is marked up as a level 1 heading. $headline = get_the_author_meta( 'headline', (int) get_query_var( 'author' ) ); if ( '' == $headline && bizznis_a11y() ) { $headline = get_the_author_meta( 'display_name', (int) get_query_var( 'author' ) ); } $intro_text = get_the_author_meta( 'intro_text', (int) get_query_var( 'author' ) ); # If there's a description (intro text) to display, it is run through 'wpautop()' before being added to a div. $headline = $headline ? sprintf( '

%s

', strip_tags( $headline ) ) : ''; $intro_text = $intro_text ? apply_filters( 'bizznis_author_intro_text_output', $intro_text ) : ''; if ( $headline || $intro_text ) { printf( '
%s
', $headline . $intro_text ); } } endif; add_action( 'bizznis_loop', 'bizznis_do_author_box_archive', 5 ); /** * Add author box to the top of author archive. * * @since 1.0.0 */ if ( ! function_exists( 'bizznis_do_author_box_archive' ) ) : function bizznis_do_author_box_archive() { if ( ! is_author() || get_query_var( 'paged' ) >= 2 ) { return; } if ( get_the_author_meta( 'bizznis_author_box_archive', get_query_var( 'author' ) ) ) { bizznis_author_box( 'archive' ); } } endif; add_action( 'bizznis_before_loop', 'bizznis_do_date_archive_title' ); /** * Add custom headline and description to date archive pages. * * If we're not on a date archive page, or not on page 1, then nothing extra is displayed. * * * @since 1.2.0 * * @uses bizznis_has_post_type_archive_support() Check if a post type should potentially support an archive setting page. * @uses bizznis_get_cpt_option() Get list of custom post types which need an archive settings page. * @return null Return early if not on relevant post type archive. */ if ( ! function_exists( 'bizznis_do_date_archive_title' ) ) : function bizznis_do_date_archive_title() { if ( ! is_date() ) { return; } if ( ! bizznis_a11y( 'headings' ) ) { return; } if ( get_query_var( 'paged' ) >= 2 && ! bizznis_a11y( 'headings' ) ) { return; } if ( is_day() ) { $headline = __( 'Archives for ', 'bizznis' ) . get_the_date(); } elseif ( is_month() ) { $headline = __( 'Archives for ', 'bizznis' ) . single_month_title( ' ', false ); } elseif ( is_year() ) { $headline = __( 'Archives for ', 'bizznis' ) . get_query_var( 'year' ); } if ( $headline ) { printf( '

%s

', $headline ); } } endif;