Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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 );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement