-
Notifications
You must be signed in to change notification settings - Fork 0
/
front-page.php
executable file
·69 lines (55 loc) · 1.72 KB
/
front-page.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
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
/**
* The template for displaying the landing page/blog posts
* The functions used here can be found in includes/landing-page.php
*
* @package Septera
*/
$septera_landingpage = cryout_get_option( 'septera_landingpage' );
if ( is_page() && ! $septera_landingpage ) {
load_template( get_page_template() );
return true;
}
if ( 'posts' == get_option( 'show_on_front' ) ) {
include( get_home_template() );
} else {
get_header();
?>
<div id="container" class="septera-landing-page one-column">
<main id="main" role="main" class="main">
<?php
if ( $septera_landingpage ) {
get_template_part( apply_filters('septera_landingpage_main_template', 'content/landing-page' ) );
} else {
septera_lpindex();
}
?>
</main><!-- #main -->
<?php if ( ! $septera_landingpage ) { septera_get_sidebar(); } ?>
</div><!-- #container -->
<!--Add posts to home page-->
<section class="blog text-content" >
<h1><a href="blog/">Blog</a></h1> <!-- This links expects you to be at the front page -->
<!--Post container, sets space for the posts to display-->
<div class="homePostContainer">
<!--Inner container to align post content with flex-->
<div class="homePostInner">
<ul>
<?php
// WP Query Parameters to get blog posts
$the_query = new WP_Query( array('post_type' => 'post', 'posts_per_page' => 5) ); ?>
<?php // Start of WP Query
while ($the_query -> have_posts()) : $the_query -> the_post();
// Display the Post Title with Hyperlink
get_template_part('content/content', 'blog');
// Repeat the process and reset once it hits the limit
endwhile;
wp_reset_postdata();
?>
</ul>
</div>
</div>
</section>
<!--end of post content-->
<?php get_footer();
} //else !posts