forked from jonmbennett/betheme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
218 lines (172 loc) · 7.04 KB
/
index.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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
<?php
/**
* The main template file.
*
* @package Betheme
* @author Muffin group
* @link http://muffingroup.com
*/
get_header();
// Class
$blog_classes = array();
$section_class = array();
// Class | Layout
if( $_GET && key_exists( 'mfn-b', $_GET ) ){
$blog_layout = esc_html( $_GET['mfn-b'] ); // demo
} else {
$blog_layout = mfn_opts_get( 'blog-layout', 'classic' );
}
$blog_classes[] = $blog_layout;
// Layout | Masonry Tiles | Quick Fix
if( $blog_layout == 'masonry tiles' ){
$blog_layout = 'masonry';
}
// Class | Columns
if( $_GET && key_exists( 'mfn-bc', $_GET ) ){
$blog_classes[] = 'col-'. esc_html( $_GET['mfn-bc'] ); // demo
} else {
$blog_classes[] = 'col-'. mfn_opts_get( 'blog-columns', 3 );
}
if( $_GET && key_exists( 'mfn-bfw', $_GET ) ){
$section_class[] = 'full-width'; // demo
}
if( mfn_opts_get( 'blog-full-width' ) && ( $blog_layout == 'masonry' ) ){
$section_class[] = 'full-width';
}
$section_class = implode( ' ', $section_class );
// Isotope
if( $blog_layout == 'masonry' ) $blog_classes[] = 'isotope';
// Ajax | load more
$load_more = mfn_opts_get( 'blog-load-more' );
// Translate
$translate['filter'] = mfn_opts_get('translate') ? mfn_opts_get('translate-filter','Filter by') : __('Filter by','betheme');
$translate['tags'] = mfn_opts_get('translate') ? mfn_opts_get('translate-tags','Tags') : __('Tags','betheme');
$translate['authors'] = mfn_opts_get('translate') ? mfn_opts_get('translate-authors','Authors') : __('Authors','betheme');
$translate['all'] = mfn_opts_get('translate') ? mfn_opts_get('translate-all','Show all') : __('Show all','betheme');
$translate['categories'] = mfn_opts_get('translate') ? mfn_opts_get('translate-categories','Categories') : __('Categories','betheme');
$translate['item-all'] = mfn_opts_get('translate') ? mfn_opts_get('translate-item-all','All') : __('All','betheme');
?>
<!-- #Content -->
<div id="Content">
<div class="content_wrapper clearfix">
<!-- .sections_group -->
<div class="sections_group">
<div class="extra_content">
<?php
if( get_option( 'page_for_posts' ) || mfn_opts_get( 'blog-page' ) ){
if( category_description() ){
echo '<div class="section the_content category_description">';
echo '<div class="section_wrapper">';
echo '<div class="the_content_wrapper">';
echo category_description();
echo '</div>';
echo '</div>';
echo '</div>';
} else {
mfn_builder_print( mfn_ID(), true );
}
}
?>
</div>
<?php if( ( $filters = mfn_opts_get( 'blog-filters' ) ) && in_array( get_post_type(), array( 'post', 'tribe_events' ) ) && ! is_singular() && get_option( 'page_for_posts' ) ): ?>
<div class="section section-filters">
<div class="section_wrapper clearfix">
<?php
$filters_class = '';
if( $blog_layout == 'masonry' ) $filters_class .= ' isotope-filters';
if( $filters != 1 ){
$filters_class .= ' only '. $filters;
}
?>
<!-- #Filters -->
<div id="Filters" class="column one <?php echo $filters_class; ?>">
<ul class="filters_buttons">
<li class="label"><?php echo $translate['filter']; ?></li>
<li class="categories"><a class="open" href="#"><i class="icon-docs"></i><?php echo $translate['categories']; ?><i class="icon-down-dir"></i></a></li>
<li class="tags"><a class="open" href="#"><i class="icon-tag"></i><?php echo $translate['tags']; ?><i class="icon-down-dir"></i></a></li>
<li class="authors"><a class="open" href="#"><i class="icon-user"></i><?php echo $translate['authors']; ?><i class="icon-down-dir"></i></a></li>
<li class="reset"><a class="close" data-rel="*" href="<?php echo get_permalink( mfn_ID() ); ?>"><i class="icon-cancel"></i><?php echo $translate['all']; ?></a></li>
</ul>
<div class="filters_wrapper">
<ul class="categories">
<?php
echo '<li class="reset-inner"><a data-rel="*" href="'. get_permalink( mfn_ID() ) .'">'. $translate['item-all'] .'</a></li>';
if( $categories = get_categories() ){
$exclude = mfn_get_excluded_categories();
foreach( $categories as $category ){
if( $exclude && in_array( $category->slug, $exclude ) ){
continue;
}
echo '<li><a data-rel=".category-'. $category->slug .'" href="'. get_term_link($category) .'">'. $category->name .'</a></li>';
}
}
?>
<li class="close"><a href="#"><i class="icon-cancel"></i></a></li>
</ul>
<ul class="tags">
<?php
echo '<li class="reset-inner"><a data-rel="*" href="'. get_permalink( mfn_ID() ) .'">'. $translate['item-all'] .'</a></li>';
if( $tags = get_tags() ){
foreach( $tags as $tag ){
echo '<li><a data-rel=".tag-'. $tag->slug .'" href="'. get_tag_link($tag) .'">'. $tag->name .'</a></li>';
}
}
?>
<li class="close"><a href="#"><i class="icon-cancel"></i></a></li>
</ul>
<ul class="authors">
<?php
echo '<li class="reset-inner"><a data-rel="*" href="'. get_permalink( mfn_ID() ) .'">'. $translate['item-all'] .'</a></li>';
$authors = mfn_get_authors();
if( is_array( $authors ) ){
foreach( $authors as $auth ){
echo '<li><a data-rel=".author-'. mfn_slug( $auth->data->user_login ) .'" href="'. get_author_posts_url($auth->ID) .'">'. $auth->data->display_name .'</a></li>';
}
}
?>
<li class="close"><a href="#"><i class="icon-cancel"></i></a></li>
</ul>
</div>
</div>
</div>
</div>
<?php endif; ?>
<div class="section <?php echo $section_class; ?>">
<div class="section_wrapper clearfix">
<div class="column one column_blog">
<div class="blog_wrapper isotope_wrapper">
<div class="posts_group lm_wrapper <?php echo implode(' ', $blog_classes); ?>">
<?php
// Featured images | available types
$featured_image = ''; // all
if( $load_more ){
$featured_image = 'no_slider'; // no slider if load more
}
if( mfn_opts_get( 'blog-images' ) ){
$featured_image = 'image'; // images only option
}
echo mfn_content_post( false, false, $featured_image );
?>
</div>
<?php
// pagination
if( function_exists( 'mfn_pagination' ) ):
echo mfn_pagination( false, $load_more );
else:
?>
<div class="nav-next"><?php next_posts_link(__('← Older Entries', 'betheme')) ?></div>
<div class="nav-previous"><?php previous_posts_link(__('Newer Entries →', 'betheme')) ?></div>
<?php
endif;
?>
</div>
</div>
</div>
</div>
</div>
<!-- .four-columns - sidebar -->
<?php get_sidebar( 'blog' ); ?>
</div>
</div>
<?php get_footer();
// Omit Closing PHP Tags