-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontent-best-ratings.php
102 lines (85 loc) · 2.62 KB
/
content-best-ratings.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
<table class="gdrts-best-companies gdrts-by-user-reviews">
<thead>
<th>#</th>
<th>Company</th>
<th class="editor-rating">Editor Rating</th>
<th class="users-rating">Users Rating</th>
<th>Visit</th>
</thead>
<tbody>
<?php
$query_args = array(
'posts_per_page' => 5,
'post_type' => $args['gdrts-best-post-type'],
'orderby' => 'gdrts',
'order' => 'DESC',
'gdrts_method' => 'multi-stars-rating',
'gdrts_value' => 'rating',
'gdrts_series' => $args['gdrts-best-rating-series']
);
$the_query = new WP_Query( $query_args );
if ( $the_query->have_posts() ) {
$position = 1;
while ( $the_query->have_posts() ) {
$the_query->the_post();
$item = gdrts_get_rating_item_by_post();
?>
<tr>
<td class="position" data-th="Position">
<?php echo $position ++; ?>
</td>
<td class="company-logo" data-th="Company">
<?php if ( has_post_thumbnail() ): ?>
<div class="post-thumbnail">
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail( 'medium' ); ?></a>
</div>
<?php endif; ?>
</td>
<td class="editor-rating" data-th="Editor Rating">
<?php
gdrts_posts_render_rating(
array(
'echo' => true,
'method' => 'multi-stars-review',
'series' => $args['gdrts-best-rating-series']
),
array(
'template' => 'overall',
'style_type' => 'font',
'style_name' => 'star',
'style_size' => 16,
'font_color_current' => '#ba2a2a'
)
);
?>
</td>
<td class="users-rating" data-th="Users Rating">
<?php
gdrts_posts_render_rating(
array(
'echo' => true,
'method' => 'multi-stars-rating',
'series' => $args['gdrts-best-rating-series']
),
array(
'disable_rating' => true,
'template' => 'overall',
'style_type' => 'font',
'style_name' => 'star',
'style_size' => 16,
'font_color_current' => '#ba2a2a'
)
);
?>
</td>
<td class="hosting-visit" data-th="Visit">
<a href="<?php echo $item->get_meta( 'reviewed-item_url' ); ?>" target="_blank">Visit Site</a>
</td>
</tr>
<?php
}
}
wp_reset_query();
?>
</tbody>
</table>