This repository was archived by the owner on Jul 7, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcustom-archive.php
More file actions
executable file
·128 lines (107 loc) · 3.8 KB
/
custom-archive.php
File metadata and controls
executable file
·128 lines (107 loc) · 3.8 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
122
123
124
125
126
127
128
<?php
/*
Template Name: Custom Archive
*/
get_header(); ?>
<header class="page-titles">
<div class="container clearfix">
<!-- Page title -->
<h2 class="entry-title"><?php the_title(); ?></h2>
<!-- Subtitle -->
<?php if ( get_post_meta($post->ID, 'subtitle', true) ) { ?>
<h3 class="entry-subtitle"><?php echo get_post_meta($post->ID, 'subtitle', true) ?></h3>
<?php } ?>
</div>
</header>
<section class="main">
<div class="container clearfix">
<div id="content">
<div class="posts">
<!-- Grab the posts -->
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<article <?php post_class('post'); ?>>
<div class="box-wrap">
<div class="box">
<!-- Post content -->
<div class="post-content clearfix">
<?php the_content(__( 'Read More','north')); ?>
<div id="archive">
<div class="archive-col">
<div class="archive-box">
<h3><?php _e('Latest Posts','north'); ?></h3>
<ul>
<?php wp_get_archives('type=postbypost&limit=10'); ?>
</ul>
</div>
<div class="archive-box">
<h3><?php _e('Portfolio Items','north'); ?></h3>
<ul>
<?php
if ( get_query_var('paged') ) {
$paged = get_query_var('paged');
} else if ( get_query_var('page') ) {
$paged = get_query_var('page');
} else {
$paged = 1;
}
$args = array('post_type' => 'array-portfolio', 'posts_per_page' => 10, 'paged' => $paged );
$temp = $wp_query;
$wp_query = null;
$wp_query = new WP_Query();
$wp_query->query( $args );
while ($wp_query->have_posts()) : $wp_query->the_post();
?>
<li><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></li>
<?php endwhile; ?>
<?php
$wp_query = null;
$wp_query = $temp; // Reset
?>
</ul>
</div>
<div class="archive-box">
<h3><?php _e('Categories','north'); ?></h3>
<ul>
<?php wp_list_categories('orderby=name&title_li='); ?>
</ul>
</div>
<div class="archive-box">
<h3><?php _e('Archive By Day','north'); ?></h3>
<ul>
<?php wp_get_archives('type=daily&limit=15'); ?>
</ul>
</div>
<div class="archive-box">
<h3><?php _e('Archive By Month','north'); ?></h3>
<ul>
<?php wp_get_archives('type=monthly&limit=12'); ?>
</ul>
</div>
<div class="archive-box">
<h3><?php _e('Archive By Year','north'); ?></h3>
<ul>
<?php wp_get_archives('type=yearly&limit=12'); ?>
</ul>
</div>
<div class="archive-box">
<h3><?php _e('Contributors','north'); ?></h3>
<ul>
<?php wp_list_authors('show_fullname=1&optioncount=0&orderby=post_count&order=DESC'); ?>
</ul>
</div>
</div><!-- column -->
</div><!-- archive -->
</div><!-- post content -->
</div><!-- box -->
</div><!-- box wrap -->
</article><!-- post-->
<?php endwhile; ?>
<?php endif; ?>
</div><!-- posts -->
</div><!-- content -->
<!-- Sidebar -->
<?php get_sidebar(); ?>
</div><!-- container -->
</section><!-- main -->
<!-- Footer -->
<?php get_footer(); ?>