/
index.php
41 lines (36 loc) · 1.18 KB
/
index.php
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
<?php
/**
* The main template file
*
* This is the most generic template file in a WordPress theme and one
* of the two required files for a theme (the other being style.css).
* It is used to display a page when nothing more specific matches a query,
* e.g., it puts together the home page when no home.php file exists.
*
* @link http://codex.wordpress.org/Template_Hierarchy
*
* @package WordPress
* @subpackage Skillcrush_Starter
* @since Skillcrush Starter 2.0
*/
get_header(); ?>
<section class="index-page">
<div class="main-content">
<?php if ( have_posts() ): ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part('content-blog', get_post_format()); ?>
<?php endwhile; ?>
<?php endif; ?>
</div>
<?php get_sidebar(); ?>
</section>
<nav id="navigation" class="container">
<div class="left"><?php next_posts_link('← <span>Older Posts</span>'); ?></div>
<div class="pagination">
<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
echo 'Page '.$paged.' of '.$wp_query->max_num_pages;
?>
</div>
<div class="right"><?php previous_posts_link('<span>Newer Posts</span> →'); ?></div>
</nav>
<?php get_footer(); ?>