/
loop-featured.php
85 lines (49 loc) · 2.04 KB
/
loop-featured.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
<?php
/**
* Loop for displaying most popular ads
*
* @package ClassiPress
* @author AppThemes
*
*/
global $pageposts;
$pageposts = cp_get_popular_ads();
?>
<?php appthemes_before_loop(); ?>
<?php if ( $pageposts ) : ?>
<?php foreach ( $pageposts as $post ) : ?>
<?php setup_postdata( $post ); ?>
<?php appthemes_before_post(); ?>
<div class="post-block-out">
<div class="post-block">
<?php if(in_array($post->ID, get_option('sticky_posts'))) { ?>
<span class="i_featured">Featured</span>
<?php } ?>
<?php if (get_post_meta($post->ID, 'cp_ad_sold', true) == 'yes') : ?>
<span class="i_sold">Sold</span>
<?php endif; ?>
<div class="post-left">
<?php if ( get_option('cp_ad_images') == 'yes' ) cp_ad_loop_thumbnail(); ?>
</div>
<div class="<?php if ( get_option('cp_ad_images') == 'yes' ) echo 'post-right'; else echo 'post-right-no-img'; ?> <?php echo get_option('cp_ad_right_class'); ?>">
<?php appthemes_before_post_title(); ?>
<h3><a href="<?php the_permalink(); ?>"><?php if ( mb_strlen( get_the_title() ) >= 75 ) echo mb_substr( get_the_title(), 0, 75 ).'...'; else the_title(); ?></a></h3>
<div class="clr"></div>
<?php appthemes_after_post_title(); ?>
<div class="clr"></div>
<?php appthemes_before_post_content(); ?>
<p class="post-desc"><?php echo cp_get_content_preview( 160 ); ?></p>
<?php appthemes_after_post_content(); ?>
<div class="clr"></div>
</div>
<div class="clr"></div>
</div><!-- /post-block -->
</div><!-- /post-block-out -->
<?php appthemes_after_post(); ?>
<?php endforeach; ?>
<?php appthemes_after_endwhile(); ?>
<?php else: ?>
<?php appthemes_loop_else(); ?>
<?php endif; ?>
<?php appthemes_after_loop(); ?>
<?php wp_reset_query(); ?>