-
Notifications
You must be signed in to change notification settings - Fork 1
/
getsearch.php
35 lines (34 loc) · 904 Bytes
/
getsearch.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
<?php
include('wp-config.php');
global $wpdb;
if(isset($_POST['survey']) && $_POST['survey']!=""){
$countArray = count($_POST['survey']);
for($a = 0; $a<$countArray; $a++)
{
if($_POST['survey'][$a] != $_POST['removeVal']){
$srch[] = $_POST['survey'][$a];
}
}
$catIn = implode(',',$srch);
}
$args = array(
'posts_per_page' => -1,
'post_type' => 'post',
'orderby' => 'title',
'order' => 'DESC',
/* 'paged' => $paged, */
'post_status' => 'publish',
'cat' => $catIn
);
$custom_query = new WP_Query( $args );
while($custom_query->have_posts()) :
$custom_query->the_post();
?>
<div class="post-row clearfix">
<div class="post-thumbnail col-md-4 col-sm-4"><?php the_post_thumbnail(); ?></div>
<div class="post-data col-md-8 col-sm-8">
<h2 class="post-title"><?php the_title(); ?></h2>
<?php the_excerpt (); ?>
</div>
</div>
<?php endwhile; ?>