forked from Purdue/purdue-wp-theme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
home.php
122 lines (115 loc) · 3.4 KB
/
home.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<?php
/**
* Default archive page
*
* @package purdue-wp-theme
*/
?>
<?php get_header(); ?>
<main id="site-content" role="main" class="main-content">
<section class="section">
<div class="container">
<div class="content">
<h1><?php echo get_bloginfo( 'name' ); ?></h1>
<?php if(get_bloginfo( 'description' )){
echo '<p>'.get_bloginfo( 'description' ).'</p>';
}
?>
</div>
</div>
</section>
<div class="section post-container">
<div class="container">
<div class="columns is-multiline">
<?php
/* $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args = array( 'post_type' => 'post', 'paged' => $paged);
$wp_query = new WP_Query($args);
*/
global $more;
while ( have_posts() ) : the_post();
if (is_sticky()) { ?>
<div class="column is-full">
<div class="card listed-post">
<?php if (has_post_thumbnail()) { ?>
<div class="card-image">
<figure class="card-bg-image image is-2by1" style="background-image:url('<?php echo wp_get_attachment_url(get_post_thumbnail_id($post->ID)); ?>');">
</figure>
</div>
<?php } ?>
<div class="card-content">
<div class="media">
<div class="media-content">
<p class="subtitle">
Last Update: <?php the_modified_time('F j, Y'); ?>
</p>
<?php /* Hide for now
<h4 class="title is-4">
<?php the_title(); ?>
</h4>
*/ ?>
</div>
</div>
<div class="content">
<?php $more = false; echo get_the_content(); ?>
</div>
</div>
</div>
</div>
<?php } else { ?>
<div class="column is-one-third-desktop is-half-tablet is-full-mobile">
<div class="card listed-post">
<a href="<?php the_permalink(); ?>">
<?php if (has_post_thumbnail()) { ?>
<div class="card-image">
<figure class="card-bg-image image is-2by1" style="background-image:url('<?php echo wp_get_attachment_url(get_post_thumbnail_id($post->ID)); ?>');">
</figure>
</div>
<?php } ?>
<div class="card-content">
<div class="media">
<div class="media-content">
<p class="subtitle">
<?php the_time('F j, Y'); ?>
</p>
<p class="title is-4">
<?php the_title(); ?>
</p>
</div>
</div>
<div class="content-text">
<?php
$more = true;
if( has_excerpt() ){
the_excerpt();
}else{
echo purdue_get_excerpt(get_the_content());
}
?>
</div>
<div class="read-more-button">
<span>Read More</span>
</div>
</div>
</a>
</div>
</div>
<?php } ?>
<?php endwhile; ?>
</div>
<?php
the_posts_pagination( array(
'mid_size' => 2,
'prev_text' => __( 'Prev', 'textdomain' ),
'next_text' => __( 'Next', 'textdomain' ),
) );
?>
</div>
</div>
<?php if (!has_block('purdue-blocks/anchor-link-navigation')&&!has_block('purdue-blocks/custom-side-menu')) { ?>
<button id="to-top" class="to-top-hidden" aria-label="Back to Top Button">
<span class="icon"><i class="fa-solid fa-arrow-up" aria-hidden="true"></i></span>
</button>
<?php } ?>
</main><!-- #site-content -->
<?php get_footer(); ?>