-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpage.php
More file actions
69 lines (60 loc) · 2.29 KB
/
page.php
File metadata and controls
69 lines (60 loc) · 2.29 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
68
69
<?
get_header();
while (have_posts()): the_post();
?>
<?php get_template_part('template-parts/components/article-header'); ?>
<main>
<div class="c slim">
<div class="grid-50">
<div class="col-3-5 content">
<?php the_content(); ?>
<?php get_template_part('template-parts/sections/sidebar-widgets'); ?>
</div><!-- col -->
<div class="col-2-5">
<?
// Recent Articles
$articles = new WP_Query(['posts_per_page' => 3]);
while ($articles->have_posts()): $articles->the_post(); ?>
<a href="<?php the_permalink(); ?>" class="article-card">
<img src="<?php echo wp_get_attachment_url(get_post_thumbnail_id($post->ID), 'medium'); ?>">
<h3><?php the_title(); ?></h3>
</a>
<?php endwhile;
wp_reset_postdata(); ?>
</div><!-- col -->
</div><!-- grid -->
</div><!-- c -->
</main>
<?
// Related Articles Section
$related_query = new WP_Query(array(
'post_type' => 'post',
'posts_per_page' => 6,
'orderby' => 'date',
));
?>
<section class="front-page-learn">
<div class="c">
<h2 class="text-center">Related Articles</h2>
<div class="grid-50 clear-col-3">
<?php while ($related_query->have_posts()): $related_query->the_post(); ?>
<div class="col-1-3">
<div class="front-page-learn-box">
<a
class="front-page-learn-box-img"
href="<?php the_permalink(); ?>"
style="background-image: url('<?php the_post_thumbnail_url(get_the_ID(), 'medium'); ?>');">
</a>
<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
<?php get_template_part('template-parts/components/byline'); ?>
</div><!-- front-page-learn-box -->
</div><!-- col-1-3 -->
<?php endwhile; ?>
<?php wp_reset_postdata(); ?>
</div><!-- grid -->
</div><!-- c -->
</section><!-- front-page-learn -->
<?
endwhile;
get_footer();
?>