-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patharchive.php
More file actions
121 lines (106 loc) · 3.55 KB
/
Copy patharchive.php
File metadata and controls
121 lines (106 loc) · 3.55 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
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
<?php
/**
* Archive Template File.
*
* @package PlayPixelPro
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
get_header();
$prompt_prefix = get_theme_mod( 'playpixelpro_prompt_prefix', 'user@dev-root:~$' );
$enable_cursor = get_theme_mod( 'playpixelpro_enable_cursor', true );
?>
<header style="margin-bottom: 32px;">
<h1 style="font-size: 1.8rem; margin: 0 0 4px; color: var(--gold); text-transform: none;">
<span style="color: var(--muted);"><?php echo esc_html( $prompt_prefix ); ?></span> ls /archive/<?php single_term_title(); ?>
<?php if ( $enable_cursor ) : ?>
<span class="cli-cursor"></span>
<?php endif; ?>
</h1>
<div class="meta" style="font-size: 0.85rem; color: var(--muted);">
Listing archive objects for <?php the_archive_title(); ?>... [OK]
</div>
</header>
<div class="blog-layout-grid">
<section class="blog-posts-column">
<?php if ( have_posts() ) : ?>
<div class="blog-entries-container">
<?php
$post_count = 0;
$in_grid = false;
while ( have_posts() ) :
the_post();
$post_count++;
$post_slug = get_post_field( 'post_name' );
if ( 2 === $post_count ) {
echo '<div class="blog-posts-2col-grid">';
$in_grid = true;
}
?>
<article id="post-<?php the_ID(); ?>" <?php post_class( 1 === $post_count ? 'blog-entry-card featured-latest-card' : 'blog-entry-card' ); ?>>
<div class="blog-entry-header">
<span class="blog-date">[<?php echo esc_html( get_the_date( 'Y-m-d' ) ); ?>]</span>
<?php if ( 1 === $post_count ) : ?>
<span class="meta-badge" style="background: var(--gold); color: #16130b; font-weight: 700;">LATEST_ENTRY</span>
<?php endif; ?>
</div>
<?php if ( has_post_thumbnail() ) : ?>
<div class="<?php echo ( 1 === $post_count ) ? 'blog-hero-thumbnail' : 'blog-entry-thumbnail'; ?>">
<a href="<?php the_permalink(); ?>">
<?php the_post_thumbnail( 1 === $post_count ? 'large' : 'medium', array( 'class' => 'blog-thumbnail-img', 'alt' => get_the_title() ) ); ?>
</a>
</div>
<?php endif; ?>
<h2 class="blog-entry-title">
<a href="<?php the_permalink(); ?>"><?php echo esc_html( $post_slug ); ?>.md</a>
</h2>
<div class="blog-entry-excerpt">
<p><?php echo wp_kses_post( playpixelpro_truncate( get_the_excerpt(), 1 === $post_count ? 30 : 15 ) ); ?></p>
</div>
<div class="blog-entry-footer">
<div class="tag-badge-wrap">
<?php
$tags = get_the_tags();
if ( $tags ) {
foreach ( $tags as $tag ) {
echo '<span class="tag-badge">#' . esc_html( strtolower( $tag->name ) ) . '</span>';
}
} else {
$categories = get_the_category();
if ( $categories ) {
foreach ( $categories as $cat ) {
echo '<span class="tag-badge">#' . esc_html( strtolower( $cat->name ) ) . '</span>';
}
}
}
?>
</div>
<a class="button" href="<?php the_permalink(); ?>">CONTINUE_READING ></a>
</div>
</article>
<?php endwhile; ?>
<?php
if ( $in_grid ) {
echo '</div>'; // Close .blog-posts-2col-grid
}
?>
</div>
<div class="terminal-pagination">
<?php
echo paginate_links(
array(
'prev_text' => __( '< PREV', 'playpixelpro' ),
'next_text' => __( 'NEXT >', 'playpixelpro' ),
)
);
?>
</div>
<?php else : ?>
<p><?php esc_html_e( 'No archive objects found.', 'playpixelpro' ); ?></p>
<?php endif; ?>
</section>
<?php get_sidebar(); ?>
</div>
<?php
get_footer();