-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharchive.php
81 lines (61 loc) · 1.89 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
<?php
/**
* The template for displaying archive pages.
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
* @package mindup
*/
get_header(); ?>
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<?php
/*
* mobile only search
*/
get_template_part( 'template-parts/mobile', 'search' );
if ( have_posts() ) : // if archive has posts
$posts_count = 0; // set posts at zed
while ( have_posts() ) : the_post(); // start the loop
++$posts_count; // increase post count +1
if ( $posts_count == 1 && ! is_paged() ) : // if first post on first page: do custom
?>
<article id="post-<?php the_ID(); ?>" class="hero-post">
<a href="<?php echo the_permalink(); ?>">
<?php
if ( has_post_thumbnail() ) {
the_post_thumbnail( 'full' );
}
?>
</a>
<?php
the_title( '<h2 class="hero-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' ); ?>
<div class="entry-meta">
<?php mindup_posted_on(); ?>
</div><!-- .entry-meta -->
<div class="entry-content">
<?php the_excerpt(); ?>
</div><!-- .entry-content -->
<footer class="entry-footer">
<?php mindup_entry_footer(); ?>
</footer><!-- .entry-footer -->
</article><!-- /hero post -->
<?php
else : // if not first post on first page - do what you normally do
get_template_part( 'template-parts/content', 'post' );
endif;
endwhile;
else :
get_template_part( 'template-parts/content', 'none' );
endif;
?>
<div id="pagination">
<?php
if ( function_exists( mindup_pagination_archives() ) )
mindup_pagination_archives();
?>
</div><!-- end pagination -->
</main><!-- #main -->
</div><!-- #primary -->
<?php
get_footer();