forked from carolinan/Billie
-
Notifications
You must be signed in to change notification settings - Fork 0
/
archive.php
93 lines (82 loc) · 2.6 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
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
<?php
/**
* The template for displaying archive pages.
*
* Learn more: https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package Billie
*/
get_header();
if ( have_posts() && is_post_type_archive( 'jetpack-portfolio' ) || is_tax( 'jetpack-portfolio-type' ) || is_tax( 'jetpack-portfolio-tag' ) ) {
if ( have_posts() ) : ?>
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<header class="page-header">
<h1 class="page-title"><?php esc_html_e( 'Portfolio', 'billie' ); ?></h1>
</header><!-- .page-header -->
<section class="featured-wrap">
<?php
while ( have_posts() ) {
the_post();
?>
<div class="featured-post">
<?php
if ( has_post_thumbnail() ) {
$background = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'billie-featured-posts-thumb' );
echo '<div class="featured-inner" style="background: url(' . esc_url( $background[0] ) . '); center center no-repeat;">';
} else {
echo '<div class="featured-inner" style="background: ' . esc_attr( get_theme_mod( 'billie_header_bgcolor', '#9cc9c7' ) ) . ';">';
}
echo '<div class="post-header">';
the_title( sprintf( '<h2><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' );
echo '</div>
<span class="featured-text">';
echo the_terms( $post->ID, 'jetpack-portfolio-type', '' . __( 'Project Type: ', 'billie' ), ', ', '' );
echo ' <span class="tag-list">';
$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
$time_string = sprintf(
$time_string,
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() )
);
$posted_on = $time_string;
echo $posted_on;
echo '</span></span></div></div>';
}
?>
</section>
</main><!-- #main -->
</div><!-- #primary -->
<?php
endif;
get_sidebar();
get_footer();
} else {
?>
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<?php
if ( have_posts() ) {
?>
<header class="page-header">
<?php
the_archive_title( '<h1 class="page-title">', '</h1>' );
the_archive_description( '<div class="taxonomy-description">', '</div>' );
?>
</header><!-- .page-header -->
<?php
while ( have_posts() ) :
the_post();
get_template_part( 'content', get_post_format() );
endwhile;
the_posts_navigation();
} else {
get_template_part( 'content', 'none' );
}
?>
</main><!-- #main -->
</div><!-- #primary -->
<?php
get_sidebar();
get_footer();
} // End if().