Astra_Breadcrumb_Trail::add_year_archive_items()

Adds the items to the trail items array for year archives.


Description


Return

(void)


Source

File: inc/addons/breadcrumbs/class-astra-breadcrumb-trail.php

	protected function add_year_archive_items() {

		// Add $wp_rewrite->front to the trail.
		$this->add_rewrite_front_items();

		// Get the year.
		$year  = sprintf( $this->labels['archive_year'],  get_the_time( esc_html_x( 'Y', 'yearly archives date format',  'astra' ) ) );

		// Add the year item.
		if ( is_paged() ) {
			$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_year_link( get_the_time( 'Y' ) ) ), $year );
		}
		elseif ( true === $this->args['show_title'] ) {
			$this->items[] = $year;
		}
	}

Changelog

Changelog
Version Description
1.0.0 Introduced.


User Contributed Notes

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