lightspeeddevelopment /
lsx
| 1 | <?php |
||
| 2 | /** |
||
| 3 | * Archives Template. |
||
| 4 | * |
||
| 5 | * Template Name: Archives |
||
| 6 | * |
||
| 7 | * @package lsx |
||
| 8 | * @subpackage template |
||
| 9 | */ |
||
| 10 | |||
| 11 | get_header(); ?> |
||
| 12 | |||
| 13 | <?php lsx_content_wrap_before(); ?> |
||
| 14 | |||
| 15 | <div id="primary" class="content-area <?php echo esc_attr( lsx_main_class() ); ?>"> |
||
| 16 | |||
| 17 | <?php lsx_content_before(); ?> |
||
| 18 | |||
| 19 | <main id="main" class="site-main" role="main"> |
||
| 20 | |||
| 21 | <?php lsx_content_top(); ?> |
||
| 22 | |||
| 23 | <?php if ( have_posts() ) : ?> |
||
|
0 ignored issues
–
show
Coding Style
introduced
by
Loading history...
|
|||
| 24 | |||
| 25 | <?php |
||
| 26 | while ( have_posts() ) : |
||
|
0 ignored issues
–
show
|
|||
| 27 | the_post(); |
||
| 28 | ?> |
||
| 29 | |||
| 30 | <?php lsx_entry_before(); ?> |
||
| 31 | |||
| 32 | <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> |
||
| 33 | |||
| 34 | <?php lsx_entry_top(); ?> |
||
| 35 | |||
| 36 | <div class="entry-content"> |
||
| 37 | <h2><?php esc_html_e( 'The Last 30 Posts', 'lsx' ); ?></h2> |
||
| 38 | |||
| 39 | <ul> |
||
| 40 | <?php |
||
| 41 | $loop = new WP_Query( |
||
| 42 | array( |
||
| 43 | 'posts_per_page' => 30, |
||
| 44 | ) |
||
| 45 | ); |
||
| 46 | ?> |
||
| 47 | |||
| 48 | <?php if ( $loop->have_posts() ) : ?> |
||
|
0 ignored issues
–
show
|
|||
| 49 | |||
| 50 | <?php while ( $loop->have_posts() ) : ?> |
||
|
0 ignored issues
–
show
|
|||
| 51 | |||
| 52 | <?php |
||
| 53 | $loop->the_post(); |
||
| 54 | $loop->is_home = false; |
||
| 55 | ?> |
||
| 56 | |||
| 57 | <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> - <?php the_time( get_option( 'date_format' ) ); ?> - <?php echo esc_html( $post->comment_count ); ?> <?php esc_html_e( 'comments', 'lsx' ); ?></li> |
||
| 58 | |||
| 59 | <?php endwhile; ?> |
||
| 60 | |||
| 61 | <?php endif; ?> |
||
| 62 | |||
| 63 | <?php wp_reset_postdata(); ?> |
||
| 64 | </ul> |
||
| 65 | |||
| 66 | <h2><?php esc_html_e( 'Categories', 'lsx' ); ?></h2> |
||
| 67 | |||
| 68 | <ul> |
||
| 69 | <?php wp_list_categories( 'title_li=&hierarchical=0&show_count=1' ); ?> |
||
| 70 | </ul> |
||
| 71 | |||
| 72 | <h2><?php esc_html_e( 'Monthly Archives', 'lsx' ); ?></h2> |
||
| 73 | |||
| 74 | <ul> |
||
| 75 | <?php wp_get_archives( 'type=monthly&show_post_count=1' ); ?> |
||
| 76 | </ul> |
||
| 77 | </div><!-- .entry-content --> |
||
| 78 | |||
| 79 | <?php lsx_entry_bottom(); ?> |
||
| 80 | |||
| 81 | </article><!-- #post-## --> |
||
| 82 | |||
| 83 | <?php lsx_entry_after(); ?> |
||
| 84 | |||
| 85 | <?php endwhile; ?> |
||
| 86 | |||
| 87 | <?php endif; ?> |
||
| 88 | |||
| 89 | <?php lsx_content_bottom(); ?> |
||
| 90 | |||
| 91 | </main><!-- #main --> |
||
| 92 | |||
| 93 | <?php lsx_content_after(); ?> |
||
| 94 | |||
| 95 | </div><!-- #primary --> |
||
| 96 | |||
| 97 | <?php lsx_content_wrap_after(); ?> |
||
| 98 | |||
| 99 | <?php get_sidebar(); ?> |
||
| 100 | |||
| 101 | <?php |
||
| 102 | get_footer(); |
||
| 103 |