This repository was archived by the owner on Jun 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patharchive.php
More file actions
executable file
·88 lines (61 loc) · 2.31 KB
/
Copy patharchive.php
File metadata and controls
executable file
·88 lines (61 loc) · 2.31 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
<?php
//Display Header
get_header();
//Get Post ID
global $wp_query;
$post_id = isset($wp_query->post->ID) ? $wp_query->post->ID : 0;
//Get Header Image
$header_image = page_header(get_post_meta($post_id, 'qns_page_header_image_url', true));
//Get Content ID/Class
$content_id_class = content_id_class(get_post_meta($post_id, 'qns_page_sidebar', true));
//Reset Query
wp_reset_query();
/* ------------------------------------------------
Get Page Title
------------------------------------------------ */
// Category
if (is_category()) :
$page_title = sprintf( __('All posts in: "%s"', 'qns'), single_cat_title('',false) );
// Tag
elseif (is_tag()) :
$page_title = sprintf( __('All posts tagged: "%s"', 'qns'), single_tag_title('',false) );
// Author
elseif ( is_author() ) :
$userdata = get_userdata($author);
$page_title = sprintf( __('All posts by: "%s"', 'qns'), $userdata->display_name );
// Day
elseif ( is_day() ) :
$page_title = sprintf( __( 'Daily Archives: <span>%s</span>', 'qns' ), get_the_date() );
// Month
elseif ( is_month() ) :
$page_title = sprintf( __( 'Monthly Archives: <span>%s</span>', 'qns' ), get_the_date( _x( 'F Y', 'monthly archives date format', 'qns' ) ) );
// Year
elseif ( is_year() ) :
$page_title = sprintf( __( 'Yearly Archives: <span>%s</span>', 'qns' ), get_the_date( _x( 'Y', 'yearly archives date format', 'qns' ) ) );
else :
$page_title = __('Archives', 'qns');
endif; ?>
<div id="page-header" <?php echo $header_image; ?>>
<h2><?php echo $page_title; ?></h2>
</div>
<!-- BEGIN .content-wrapper -->
<div class="content-wrapper clearfix">
<!-- BEGIN .main-content -->
<div class="<?php echo $content_id_class; ?> page-content">
<?php if ( have_posts() ) : ?>
<ul class="article-category-col-2 clearfix">
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'loop', 'style1' ); ?>
<?php endwhile; ?>
</ul>
<?php load_template( get_template_directory() . '/includes/pagination.php' ); ?>
<?php else : ?>
<p><?php _e( 'Apologies, but no results were found. Perhaps searching will help find a related post.', 'qns' ); ?></p>
<?php get_search_form(); ?>
<?php endif; ?>
<!-- END .main-content -->
</div>
<?php get_sidebar(); ?>
<!-- END .content-wrapper -->
</div>
<?php get_footer(); ?>