-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
175 lines (115 loc) · 3.97 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
<?php
/**
* The main template file
*
* This is the most generic template file in a WordPress theme
* and one of the two required files for a theme (the other being style.css).
* It is used to display a page when nothing more specific matches a query.
* E.g., it puts together the home page when no home.php file exists.
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
* @package WordPress
* @subpackage Twenty_Seventeen
* @since 1.0
* @version 1.0
*/
get_header(); ?>
<div class="wrap">
<?php
$show_blog_archive_title = (bool)get_theme_mod( 'sed_show_blog_archive_title' , '1' );
if( $show_blog_archive_title === true || site_editor_app_on() ) {
$hide_class = ($show_blog_archive_title === false) ? "hide" : "";
?>
<?php if (is_home() && !is_front_page()) : ?>
<header class="page-header <?php echo esc_attr( $hide_class ) ;?>">
<h1 class="page-title"><?php single_post_title(); ?></h1>
</header>
<?php else : ?>
<header class="page-header <?php echo esc_attr( $hide_class ) ;?>">
<h2 class="page-title"><?php _e('Blog', 'twentyseventeen'); ?></h2>
</header>
<?php endif; ?>
<?php
}
?>
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<?php
if ( have_posts() ) {
?>
<div class="posts-archive-wrapper">
<?php
$num_post = 1;
/* Start the Loop */
while ( have_posts() ) : the_post();
$post_thumbnail_id = 0;
if ( '' !== get_the_post_thumbnail() ){
$post_thumbnail_id = get_post_thumbnail_id( get_the_ID() );
}
$img = get_sed_attachment_image_html( $post_thumbnail_id , "" , "500X330" );
if ( ! $img ) {
$img = array();
$img['thumbnail'] = '<img class="sed-image-placeholder sed-image" src="' . sed_placeholder_img_src() . '" />';
}
$excerpt_length = 440;
$content_post = apply_filters( 'the_excerpt', get_the_excerpt() );
if( strlen( $content_post ) > $excerpt_length )
$content_post = mb_substr( $content_post , 0 , $excerpt_length - 3 ) . '...';
?>
<div class="posts-archive-item">
<div class="tme-wrapper row">
<?php if( $num_post % 2 == 1 ) { ?>
<div class="col-sm-6">
<div class="tme-img">
<?php echo $img['thumbnail'];?>
</div>
</div>
<?php } ?>
<div class="col-sm-6">
<div class="tme-heading">
<div class="tme-heading-inner">
<h4><?php the_title();?></h4>
<div><?php echo __("Updated On:" , "omid") . " " .twentyseventeen_time_link();?></div>
</div>
</div>
<div class="tme-content">
<div class="tme-content-inner">
<?php echo $content_post;?>
</div>
<div class="tme-btn"><a href="<?php the_permalink();?>" class="text-first-main"><?php echo __("Read More","omid");?></a></div>
</div>
</div>
<?php if( $num_post % 2 == 0 ) { ?>
<div class="col-sm-6">
<div class="tme-img">
<?php echo $img['thumbnail'];?>
</div>
</div>
<?php } ?>
</div>
</div>
<?php
$num_post++;
endwhile;
?>
</div>
<?php
the_posts_pagination( array(
'prev_text' => twentyseventeen_get_svg( array( 'icon' => 'arrow-left' ) ) . '<span class="screen-reader-text">' . __( 'Previous page', 'twentyseventeen' ) . '</span>',
'next_text' => '<span class="screen-reader-text">' . __( 'Next page', 'twentyseventeen' ) . '</span>' . twentyseventeen_get_svg( array( 'icon' => 'arrow-right' ) ),
'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentyseventeen' ) . ' </span>',
) );
}else{
?>
<div class="not-found-post">
<p><?php echo __("Not found result" , "site-editor" ); ?> </p>
</div>
<?php
}
?>
</main><!-- #main -->
</div><!-- #primary -->
<?php get_sidebar(); ?>
</div><!-- .wrap -->
<?php get_footer();