-
Notifications
You must be signed in to change notification settings - Fork 11
/
index.php
executable file
·178 lines (169 loc) · 7.5 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
<?php
global $post,$wp_query;
get_header();
?>
<!-- Blog Header
======================================================================== -->
<div class="blog-header-wrapper">
<?php
$color = oneengine_option('header_blog_color');
$img = oneengine_option('header_blog_img', false, 'url');
$repeat = oneengine_option('header_blog_repeat');
$parallax = oneengine_option('header_blog_parallax');
$cover = oneengine_option('header_blog_cover');
$bg_repeat = '';
if( $repeat == 1 || $repeat == true){
$bg_repeat = 'background-repeat:no-repeat;';
}else $bg_repeat = 'background-repeat:repeat;';
$bg_cover = '';
if( $cover == 1 || $cover == true){
$bg_cover = 'background-size:cover;';
}else $bg_cover = '';
$bg_img = '';
if( $img ){
$bg_img = 'background-image:url('.oneengine_option('header_blog_img', false, 'url').');';
}else $bg_img = '';
$img = ( ! empty ( $img ) ) ? ''.$bg_img.'' : '';
$color = ( ! empty ( $color ) ) ? 'background-color:'. $color .';' : '';
$repeat = ( ! empty ( $repeat ) ) ? ''. $bg_repeat .';' : '';
$cover = ( ! empty ( $cover ) ) ? ''. $bg_cover .'' : '';
$parallax = ( ! empty ( $parallax ) ) ? 'background-attachment: fixed;': '';
/** Style Container */
$style = (
! empty( $img ) ||
! empty( $color ) ||
! empty( $repeat ) ||
! empty( $cover ) ||
! empty( $parallax ) ) ?
sprintf( '%s %s %s %s %s', $img, $color, $repeat, $cover, $parallax ) : '';
$css = '';
if ( ! empty( $style ) ) {
$css = 'style="'. $style .'" ';
}
?>
<div class="blog-header-img" <?php echo $css ?>></div>
<div class="container">
<div class="row">
<?php
$color_title = oneengine_option('header_blog_title_color');
$color_sub_title = oneengine_option('header_blog_subtitle_color');
$color_title = ( ! empty ( $color_title ) ) ? 'color:'. $color_title .';' : '';
$color_sub_title = ( ! empty ( $color_sub_title ) ) ? 'color:'. $color_sub_title .';' : '';
/** Style Container */
$title_color = (
! empty( $color_title ) ) ?
sprintf( '%s', $color_title) : '';
$css_title_color = '';
if ( ! empty( $title_color ) ) {
$css_title_color = 'style="'. $title_color .'" ';
}
$sub_title_color = (
! empty( $color_sub_title ) ) ?
sprintf( '%s', $color_sub_title) : '';
$css_sub_title_color = '';
if ( ! empty( $sub_title_color ) ) {
$css_sub_title_color = 'style="'. $sub_title_color .'" ';
}
?>
<div class="animation-wrapper col-md-12">
<div class="heading-title-wrapper blog-page" style="color">
<h2 class="title" <?php echo $css_title_color ?>><?php echo oneengine_option('header_blog_title') ?></h2>
<span class="line-title" style="background-color:#cc467c"></span>
<span class="sub-title" <?php echo $css_sub_title_color ?>><?php echo oneengine_option('header_blog_subtitle') ?></span>
</div>
</div>
</div>
</div>
</div>
<!-- End Blog Header -->
<div class="clearfix"></div>
<!-- Container
======================================================================== -->
<div class="blog-filter-container">
<div class="row">
<div class="col-md-12 blog-filer">
<ul>
<li class="<?php echo get_query_var( 'cat' ) ? '' : "active" ?>">
<a href="<?php if( get_option( 'show_on_front' ) == 'page' ) echo get_permalink( get_option('page_for_posts' ) );
else echo bloginfo('url'); ?>">
<?php _e('All','oneengine') ?>
</a>
</li>
<?php
$categories = get_categories( array('hide_empty' => 0) );
foreach ($categories as $category) {
?>
<li class="<?php echo get_query_var( 'cat' ) == $category->term_id ? 'active' : '' ; ?>">
<a href="<?php echo get_category_link( $category );?>">
<?php echo $category->name ?>
</a>
</li>
<?php } ?>
</ul>
</div>
</div>
</div>
<div class="site-inner">
<div class="wrap">
<div class="container">
<div class="row">
<div class="blog-wrapper animation-wrapper col-md-12" style="margin:10px 0 10px">
<div class="row" id="posts_container">
<?php
$i = 0;
if (have_posts()) :
while(have_posts()) : the_post();
?>
<div class="col-md-6 et-blog-post animated fadeInUp" style="-webkit-animation-duration: 500ms; -moz-animation-duration: 500ms; -o-animation-duration: 500ms;animation-duration: 500ms; animation-delay: 300ms; -webkit-animation-delay:300ms; -moz-animation-delay:300ms;-o-animation-delay:300ms;">
<div class="image-blog-wrapper">
<?php the_post_thumbnail( 'full', array('class' => 'et-post-thumbnail img-responsive') ); ?>
<div class="et-post-data-left mobile-blog">
<span class="et-post-month"><?php the_time('M');?></span>
<span class="et-post-date"><?php the_time('d');?></span>
<a href="#" data-id="<?php echo $post->ID; ?>" class="et-like-post <?php echo is_like_post($post->ID); ?>">
<span class="et-post-heart"><i class="fa fa-heart"></i><span class="count"><?php echo get_post_meta($post->ID, 'et_like_count', true) ? get_post_meta($post->ID, 'et_like_count', true) : 0; ?></span></span>
</a>
</div>
</div>
<div class="clearfix"></div>
<div class="et-post-data container">
<div class="row">
<div class="col-md-2 col-sm-2 et-post-data-left">
<span class="et-post-month"><?php the_time('M');?></span>
<span class="et-post-date"><?php the_time('d');?></span>
<a href="#" data-id="<?php echo $post->ID; ?>" class="et-like-post <?php echo is_like_post($post->ID); ?>">
<span class="et-post-heart"><i class="fa fa-heart"></i><span class="count"><?php echo get_post_meta($post->ID, 'et_like_count', true) ? get_post_meta($post->ID, 'et_like_count', true) : 0; ?></span></span>
</a>
</div>
<div class="col-md-10 col-sm-10 et-post-data-right">
<h1 class="title-blog"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
<div class="et-post-info">
<?php _e('Post by','oneengine'); ?> <?php the_author(); ?> | <?php the_category(); ?> | <?php comments_number( 'No Comments', 'One Comment', '% Comments' ); ?>
</div>
<div class="clearfix"></div>
<div class="et-post-excerpt">
<?php the_excerpt() ?>
</div>
<div class="clearfix"></div>
<a href="<?php the_permalink(); ?>" class="read-more"><i class="fa fa-arrow-right"></i> <?php _e('Read more','oneengine'); ?></a>
</div>
</div>
</div>
</div>
<?php
$i++;
if($i % 2 == 0) echo '<div class="clearfix"></div>';
endwhile;
endif;
wp_reset_query();
?>
</div>
</div>
<input type="hidden" id="current_page" value="<?php echo get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1 ?>">
<input type="hidden" id="max_page" value="<?php echo $wp_query->max_num_pages ?>">
</div>
</div>
</div>
</div>
<!-- Container / End -->
<?php get_footer(); ?>