-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patharchive.php
55 lines (42 loc) · 1.23 KB
/
archive.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
<?php
/**
* The template for displaying archive pages
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package Hale
* Theme Hale with GDS styles
* © Crown Copyright
* @version 4.12 Sept 2024
*/
get_header();
$sidebar = hale_show_sidebar();
?>
<div id="primary" class="govuk-grid-column-two-thirds">
<?php
// Display archive title and description
the_archive_title( '<h1 class="govuk-heading-l">', '</h1>' );
the_archive_description( '<div class="archive-description">', '</div>' );
?>
<div class="<?php if ( $sidebar ) : echo hale_sidebar_location( 'sidebar-2' ); endif; ?> archive">
<?php
// Loop through all archived posts
if ( have_posts() ) :
while ( have_posts() ) :
the_post();
// Load posts as individual list item
get_template_part( 'template-parts/content', 'archive-list-item' );
endwhile;
else : ?>
<p><?php _e( 'No articles found', 'hale' ); ?></p>
<?php endif; ?>
</div>
<?php
// Display the sidebar if applicable
if ( $sidebar ) :
get_sidebar( 'blog' );
endif;
?>
</div><!-- #primary -->
<?php
get_footer();