
Smart Archive Reloaded Custom_Generator Months without links
By: a guest on
May 29th, 2012 | syntax:
PHP | size: 0.98 KB | hits: 39 | expires: Never
class SAR_Custom_Generator extends SAR_Generator {
// The list
protected function generate_list() {
$months_long = $this->get_months();
$list = '';
foreach ( $this->get_years_with_posts( 'desc' ) as $year ) {
foreach ( range( 12, 1 ) as $i ) {
// Get post links for current month
$post_list = $this->generate_post_list( $year, $i, "\n\t\t" );
if ( !$post_list )
continue;
// Set title format
if ( $this->args->anchors )
$el = "h2 id='{$year}{$i}'";
else
$el = "h2";
// Append to list
$list .=
html( $el, $months_long[$i] . ' ' . $year );
$list .= html( 'ul', $post_list );
} // end month block
} // end year block
return html( 'div id="smart-archives-list"', $list );
}
}