Astra_Breadcrumb_Trail::add_month_archive_items()
Adds the items to the trail items array for month archives.
Description
Return
(void)
Source
File: inc/addons/breadcrumbs/class-astra-breadcrumb-trail.php
protected function add_month_archive_items() {
// Add $wp_rewrite->front to the trail.
$this->add_rewrite_front_items();
// Get the year and month.
$year = sprintf( $this->labels['archive_year'], get_the_time( esc_html_x( 'Y', 'yearly archives date format', 'astra' ) ) );
$month = sprintf( $this->labels['archive_month'], get_the_time( esc_html_x( 'F', 'monthly archives date format', 'astra' ) ) );
// Add the year item.
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_year_link( get_the_time( 'Y' ) ) ), $year );
// Add the month item.
if ( is_paged() ) {
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_month_link( get_the_time( 'Y' ), get_the_time( 'm' ) ) ), $month );
}
elseif ( true === $this->args['show_title'] ) {
$this->items[] = $month;
}
}
Expand full source code Collapse full source code View on Trac
Changelog
| Version | Description |
|---|---|
| 1.0.0 | Introduced. |