-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharchive-guide.php
executable file
·79 lines (63 loc) · 1.74 KB
/
archive-guide.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
<?php
/**
* The template for displaying Archive pages
*/
get_header();
// lets globalize the wp_query var
global $wp_query;
// set the args based on current query
$args = $wp_query->query_vars;
// set paged value based on request
$args['posts_per_page'] = 100;
$args['orderby'] = 'title';
$args['order'] = "ASC";
// rerun the query
query_posts( $args );
// calculate results range to show above the result listing
if ( $paged > 0 ) {
$result_range_start = ( ( $paged - 1 ) * $args['posts_per_page'] ) + 1;
$result_range_end = ( $result_range_start + ( $args['posts_per_page'] - 1 ) );
if ( $wp_query->found_posts > $result_range_end ) {
$result_range = $result_range_start . ' - ' . $result_range_end;
} else {
$result_range = $result_range_start . ' - ' . $wp_query->found_posts;
}
} else {
if ( $wp_query->found_posts > $args['posts_per_page'] ) {
$result_range = '1 - ' . $args['posts_per_page'];
} else {
$result_range = '1 - ' . $wp_query->found_posts;
}
}
?>
<div class="page-header" style="background-image: url(/wp-content/uploads/2021/01/tour_graphic-3.jpg);">
<div class="page-header-overlay"></div>
<div class="page-header-content">
<div class="breadcrumbs">
<a href="/library/">Library</a> »
</div>
<h1 class="page-title">Research Guides</h1>
</div>
</div>
<div class="content-wide">
<div class="article-cards blog-listing">
<?php
while ( have_posts() ) : the_post();
?>
<div class="entry">
<div class="thumbnail">
<a href="<?php the_permalink() ?>"><?php the_post_thumbnail(); ?></a>
</div>
<div class="entry-inner">
<h3><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h3>
<?php the_excerpt(); ?>
</div>
</div>
<?php
endwhile;
?>
</div>
</div>
<?php
get_footer();
?>