0
votes
1answer
60 views
+50

Custom Search Not Consistent with Results

I've set up a custom search to use the s GET variable on a URL. I want it to fetch certain results but I've come across an odd problem. First, here's my code: $search_term = $_GET['s']; ...
6
votes
3answers
90 views

Can I force WP_Query to return no results?

I'm working on a website with a search feature that allows users to search through a lot of post meta. There is a specific search pattern that I would like to forcibly return no results for. The ...
0
votes
2answers
53 views

Several loop in search result

I would like use two loops in the results after a search. First of all, I begin the loop if there is result <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> ...
1
vote
1answer
132 views

How to go about combining dropdowns / filter queries?

I'm coming up short with my googling here. (As 'filter' in wordpress always turns up more content related info). Anyway, my situation is this: I have Categories, Tags, Authors and Archive dropdowns ...
0
votes
3answers
114 views

How to modify search.php to not show pages only show posts

I want to modify search.php so that it only shows posts and not pages. Can you help? Here is the loop in search.php: <?php if (have_posts()) : ?> <?php while(have_posts()): the_post(); ...
0
votes
1answer
26 views

Search page loop banner image issue

In Header file I have added while ( have_posts() ) : the_post(); ?> <img src='banner.jpg' /> <?php } ?> ` But in Search page the banner is loop equal to number of results. How ...
-1
votes
1answer
740 views

Eliminate duplicates in a foreach loop [closed]

I've created a filter for my search results that allows people to filter user searches based on their State from their profile. The problem I am having is that there are duplicate states showing in ...
1
vote
1answer
250 views

Custom search form to display users only

I'm trying to build a custom search form for one of my pages. I need the search form to be able to search for users. Not only will it need to search for users, but by first name, last name etc.. ...
0
votes
1answer
58 views

The normal loop with different styles doesn't work in search.php

This code in the search.php file does not work: <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <?php if( get_post_type() == 'post' ) {?> <div id="post"> ...
1
vote
1answer
98 views

Get search.php results in header.php?

I want one image in header.php to change for different pages. The function in header.php looks like that: if(is_archive()): //change image to "Archives" endif; if(is_404()): //change image to ...
0
votes
1answer
546 views

Search.php - return number of results but cannot loop through

I have a following search.php page (this is just the code required for problem presentation). Why is my $total_results returning a number of posts found, but when I do a loop though it always print ...
3
votes
1answer
138 views

Search widget breaks when using multiple loops?

I have created wordpress template that uses two loops via WP_Query object. Everything works fine except Search widget. I've been pulling my hairs out for three days now Googling like a madman,but ...
0
votes
1answer
34 views

Does search.php autofilter The Loop?

I just did a normal form that redirects the results from index.php to search.php, where I pasted the normal loop code of my index.php that displays the latest posts, and I noticed only the posts from ...
0
votes
1answer
98 views

Search.php gets metadata from first post

I've got this in header.php in <head> section: $page_color = get_post_meta($post->ID, 'page_color', true); It works fine because it gets correct page_color for posts and pages but when I ...
0
votes
1answer
215 views

Related posts by searching post tags of single post as terms

I want to have a related loop of posts on single post pages and to do this I want to search the tags of the post. My first question is can you use the search in query posts for multiple terms and what ...
1
vote
0answers
106 views

Replace default Wordpress search behavior with Sphinx

I want to implement Sphinx Search in my Wordpress site but I'm not exactly sure how to change Wordpress search behavior to use Sphinx. How do I get Sphinx Search engine to replace whatever Wordpress ...
0
votes
1answer
841 views

Pagination in author, category, archive and tags pages does not work

I have implemented a no-plugin pagination taken from here: http://www.kriesi.at/archives/how-to-build-a-wordpress-post-pagination-without-plugin It's works perfecto un normal loop but when I try to ...
0
votes
1answer
101 views

How to show content of custom fields in search results?

I was able to include the pages where there are custom fields in search results but I managed not to display the content when there is nothing in the content. Is there a way to include the content of ...
1
vote
1answer
3k views

Refine search results using WP_Query

I am trying to modify (refine?) Worpress search results by using WP_Query, just as it's explained in the Codex. The snippet featured in that article is on the top of the Search Template PHP file, and ...
1
vote
1answer
131 views

Varying Search Result Pages

I have two different kinds of search results on my site and I'd like to change the look of the search result page entirely. I've played around with the search form a bit but I'm unsure how to force it ...
1
vote
1answer
249 views

Differentiate between posts and pages in search results

How can one differentiate between posts and pages in search results? What I need to do is show a the_time div for posts but not show it for pages, as it's irrelevant. With a function? <?php if ...
0
votes
1answer
455 views

Problem with WP_Query loop and search term

I have a custom query to display random posts in my sidebar like this: $newQuery = array( 'post__in' => get_option('sticky_posts'), 'post_type' => 'ad_listing', 'posts_per_page' ...
0
votes
1answer
376 views

Search results with custom loop don't update when paged

I have the following code in my search results page to split up posts per category. When I go to the 2nd page of pagination, the results are exactly the same as the first. I'm assuming $paged has to ...