-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhome.php
More file actions
52 lines (37 loc) · 1.07 KB
/
home.php
File metadata and controls
52 lines (37 loc) · 1.07 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
<?php
/**
* The main template file, feeds and home will defualt to here, before going to index.php
*
* We have a template for front page to this should only ever be used for feeds
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package slow_wheels
*/
// Currently only used for posts feed
get_header();
?>
<main id="post-<?php the_ID(); ?>" <?php post_class('sw__page'); ?>>
<?php if ( is_home() && ! is_front_page() ) : ?>
<div class="post-thumbnail sw__hero">
<?php the_post_thumbnail(); ?>
</div><!-- .post-thumbnail -->
<header class="sw__header">
<h1 class="page--header"><?php single_post_title(); ?></h1>
</header>
<?php endif; ?>
<div id="primaryContent" class="sw__page--content sw__page--feed">
<?php /* Start the Loop */
while ( have_posts() ) :
the_post();
// only news posts
if ( in_category( 'news' ) ) {
get_template_part( 'template-parts/content-post', get_post_type() );
}
endwhile; ?>
</div>
<?php the_posts_navigation(); ?>
</main><!-- #main -->
<?php
get_sidebar();
get_footer();