-
Notifications
You must be signed in to change notification settings - Fork 0
/
front-page.php
71 lines (57 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
68
69
70
71
<?php
/**
* The template for displaying all pages
*
* @package Tower
*/
get_header( 'custom');
?>
<main id="primary" class="front-main" role="main">
<?php
// Show the selected front page content.
if ( have_posts() ) :
while ( have_posts() ) :
the_post();
get_template_part( 'template-parts/content', 'front-page' ); ?>
<!-- make sure to check for if has_thumbnail and if has_excerpt, etc. -->
<aside class="bgcolor4">
<div class="container">
<h3 class="custom-title"><?php esc_html_e('Latest Articles ', 'tower') ?></h3>
<div class="row">
<?php
$query = new WP_Query( [
'post__not_in' => get_option( 'sticky_posts'),
'post_type' => 'post',
// 'category_name' => 'code',
'posts_per_page' => 3,
] );
if ($query->have_posts()) {
while ($query->have_posts()) {
$query->the_post(); ?>
<div class="recent-row">
<?php the_post_thumbnail() ?>
<a class="recent-posts-link" href="<?php the_permalink(); ?>" rel="bookmark"><h4><?php the_title(); ?></h4></a>
<?php get_template_part( 'template-parts/content', 'author' ); ?>
<!-- <span><?php the_excerpt(); ?></span> -->
<div class="excerpt"><?php echo wp_trim_words(get_the_excerpt(), 28); ?></div>
<div class="recent-post-widget">
<a class="recent-posts-button" href="<?php the_permalink(); ?>">Read more...</a>
</div>
</div>
<?php
}
}
wp_reset_postdata();
?>
</div>
</div>
</aside>
<?php
endwhile;
else :
get_template_part( 'template-parts/post/content', 'none' );
endif;
?>
</main><!-- #main -->
<?php
get_footer();