-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathcontent-popular.php
60 lines (42 loc) · 1.03 KB
/
content-popular.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
<?php
$featured_query = array(
'not_geo_query' => 1,
'post_type' => 'slider',
'posts_per_page' => -1
);
query_posts($featured_query);
if(have_posts()) :
?>
<div class="child-section popular-section">
<div class="disable-autorun">
<?php get_template_part('loop', 'carousel'); ?>
</div>
</div>
<?php
else :
wp_reset_query();
global $wp_query;
$city = afdm_get_user_city();
$popular_query = afdm_get_popular_query();
$query = array_merge($wp_query->query, $popular_query);
query_posts($query);
if(have_posts()) :
?>
<div class="child-section popular-section">
<div class="section-title featured">
<?php if($city && !get_query_var('city_not_found')) : ?>
<h2><?php _e('Popular in', 'arteforadomuseu'); ?> <?php echo $city; ?></h2>
<?php else : ?>
<h2><?php _e('Popular', 'arteforadomuseu'); ?></h2>
<?php endif; ?>
</div>
<div class="disable-autorun">
<?php get_template_part('loop', 'carousel'); ?>
</div>
</div>
<?php
endif;
wp_reset_query();
endif;
wp_reset_query();
?>