-
Notifications
You must be signed in to change notification settings - Fork 0
/
page.php
146 lines (113 loc) · 4.07 KB
/
page.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
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<?php
/**
* Template for page view including query categories
* @package themify
* @since 1.0.0
*/
?>
<?php get_header(); ?>
<?php
/** Themify Default Variables
* @var object */
global $themify; ?>
<!-- layout-container -->
<div id="layout" class="pagewidth clearfix">
<?php themify_content_before(); // hook ?>
<!-- content -->
<div id="content" class="clearfix">
<?php themify_content_start(); // hook ?>
<?php
/////////////////////////////////////////////
// 404
/////////////////////////////////////////////
if(is_404()): ?>
<h1 class="page-title" itemprop="name"><?php _e('404','themify'); ?></h1>
<p><?php _e( 'Page not found.', 'themify' ); ?></p>
<?php endif; ?>
<?php
/////////////////////////////////////////////
// PAGE
/////////////////////////////////////////////
?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div id="page-<?php the_ID(); ?>" class="type-page" itemscope itemtype="http://schema.org/Article">
<!-- page-title -->
<?php if($themify->page_title != "yes"): ?>
<h1 class="page-title" itemprop="name"><?php the_title(); ?></h1>
<?php endif; ?>
<!-- /page-title -->
<div class="page-content entry-content" itemprop="articleBody">
<?php the_content(); ?>
<?php wp_link_pages(array('before' => '<p class="post-pagination"><strong>'.__('Pages:','themify').'</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
<?php edit_post_link(__('Edit','themify'), '[', ']'); ?>
<!-- comments -->
<?php if(!themify_check('setting-comments_pages') && $themify->query_category == ""): ?>
<?php comments_template(); ?>
<?php endif; ?>
<!-- /comments -->
</div>
<!-- /.post-content -->
</div><!-- /.type-page -->
<?php endwhile; endif; ?>
<?php
/////////////////////////////////////////////
// Query Category
/////////////////////////////////////////////
if('' != $themify->query_category): ?>
<?php
// Categories for Query Posts or Portfolios
$categories = '0' == $themify->query_category? themify_get_all_terms_ids($themify->query_taxonomy) : explode(',', str_replace(' ', '', $themify->query_category));
$qpargs = array(
'post_type' => $themify->query_post_type,
'tax_query' => array(
array(
'taxonomy' => $themify->query_taxonomy,
'field' => 'id',
'terms' => $categories
)
),
'posts_per_page' => $themify->posts_per_page,
'paged' => $themify->paged,
'order' => $themify->order,
'orderby' => $themify->orderby
);
?>
<?php
query_posts(apply_filters('themify_query_posts_page_args', $qpargs)); ?>
<?php if(have_posts()): ?>
<!--I would like to thank Petr Tichy(ihatetomatoes) for posting a tutorial for this loader -->
<?php if( 'section' == $themify->query_post_type ): ?>
<div class="section_loader">
<div id="loader"></div>
</div>
<!--<div class="section_loader">
<div class="section_spinner"></div>
</div>-->
<?php endif; ?>
<!-- loops-wrapper -->
<div id="loops-wrapper" class="loops-wrapper <?php echo "$themify->layout $themify->post_layout "; echo isset( $themify->query_post_type ) && ! in_array( $themify->query_post_type, array( 'post', 'page' ) ) ? $themify->query_post_type : ''; ?>">
<?php while(have_posts()) : the_post(); ?>
<?php get_template_part('includes/loop', $themify->query_post_type); ?>
<?php endwhile; ?>
</div>
<!-- /loops-wrapper -->
<?php if(themify_is_query_page() && 'section' != $themify->query_post_type) { ?>
<?php if ($themify->page_navigation != 'yes'): ?>
<?php get_template_part( 'includes/pagination'); ?>
<?php endif; ?>
<?php } ?>
<?php else : ?>
<?php endif; ?>
<?php endif; ?>
<?php themify_content_end(); // hook ?>
</div>
<!-- /content -->
<?php themify_content_after(); // hook ?>
<?php
/////////////////////////////////////////////
// Sidebar
/////////////////////////////////////////////
if ($themify->layout != 'sidebar-none'): get_sidebar(); endif; ?>
</div>
<!-- /layout-container -->
<?php get_footer(); ?>