-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathblog.php
More file actions
executable file
·67 lines (50 loc) · 1.48 KB
/
Copy pathblog.php
File metadata and controls
executable file
·67 lines (50 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
/**
* Template Name: mynameismartin blog
*
*
* @package WordPress
* @subpackage Starkers
* @since Starkers 4.0
*/
?>
<?php get_template_parts( array( 'parts/shared/html-header', 'parts/shared/header' ) ); ?>
<?php get_template_parts( array( 'parts/shared/background-image' ) ); ?>
<div class="container">
<article>
<section class="content-body blog-posts blog " role="main">
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args= array(
'paged' => $paged,
'posts_per_page' => 8
);
global $wp_query;
//The Query
$wp_query = new WP_Query( $args );
if ( have_posts() ):
?>
<ol class="list-of-posts">
<?php
while ( $wp_query->have_posts() ) : $wp_query->the_post();?>
<li class="post">
<h3 class="blog-title"><a href="<?php esc_url( the_permalink() ); ?>" title="Permalink to <?php the_title(); ?>" rel="bookmark"><?php the_title(); ?></a></h3>
<?php the_excerpt(); ?>
<time class="meta" datetime="<?php the_time( 'Y-m-d' ); ?>" pubdate><?php the_date(); ?></time>
</li>
<?php endwhile; ?>
</ol>
<?php wp_link_pages(); ?>
<?php else: ?>
<h2>No posts to display</h2>
<?php endif;
// Reset Post Data
wp_reset_postdata();
?>
<nav class="next-prev-controls blog">
<?php mynameismartin_content_nav(); ?>
</nav>
</section>
</article>
</div>
<?php get_template_parts( array( 'parts/shared/footer','parts/shared/html-footer') ); ?>