I running WordPress on IIS & SQL server. As some of the plugins do not work correctly with DB ABSTRACTION I am using a lot of functions.php filters as so on.
To make my search results include tags I have added the following code to my functions.php - http://pastebin.com/BZG20McY
My search results now include tags, but I get plenty of duplicated posts.
Is there any way to filter WP QUERY and remove all duplicated post before going into the WHILE LOOP?
Here is my basic loop:
<?php
$query_args = explode("&", $query_string);
$search_query = array('');
foreach($query_args as $key => $string) {
$query_split = explode("=", $string);
$search_query[$query_split[0]] = urldecode($query_split[1]);
}
$search = new WP_Query($search_query);
?>
<?php if ($search->have_posts()) : ?>
<?php while ($search->have_posts()) : $search->the_post(); ?>
// SOME POSTS
<?php endwhile; ?>
<?php else : ?>
// NO POSTS
<?php endif; ?>
Any suggestions much appreciated.
