-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpost.php
executable file
·53 lines (43 loc) · 2.21 KB
/
post.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
<?php for ($i=1 ; $i <= of_get_option ( 'option_box_number' ) ; $i++) { ?>
<!-- Posts-<?php echo $i; ?> -->
<section id="post-sec" class="clearfix">
<header>
<h4>
<span>
<i class="fa fa-file-text-o fa-lg"></i>
<?php echo of_get_option ( 'option_post_title'.$i ); ?>
</span>
</h4>
</header>
<?php $post_query = new WP_Query( array('showposts' => of_get_option ( 'option_post_number'.$i ), 'cat'=> of_get_option ( 'options_post_cat'.$i ),) ); ?>
<ul>
<?php if ( $post_query->have_posts() ) : while ( $post_query->have_posts() ) : $post_query->the_post(); ?>
<li id="post-<?php the_ID(); ?>" class="clearfix">
<?php if ( has_post_thumbnail() ) {
the_post_thumbnail(array(50, 50), array('class' => 'book-img '));
} else { echo '<img class="book-img" src="' . get_bloginfo( 'stylesheet_directory' ) . '/images/default-thumb.png">'; } ?>
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a>
<div class="post-info">
<?php if( function_exists('the_views') ) { ?>
<span id="view">
<i class="fa fa-eye"></i>
<?php the_views(); ?>
</span>
<?php } ?>
<span id="date">
<i class="fa fa-calendar"></i>
<?php
if( get_the_modified_date() != get_the_date() ){
get_the_modified_date('j / m / Y');
} else {
the_time('j / m / Y');
}
?>
</span>
</div>
</li>
<?php endwhile; endif; wp_reset_postdata(); wp_reset_query; ?>
</ul>
</section>
<!-- Posts-<?php echo $i; ?> -->
<?php } ?>