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
0answers
17 views

include taxonomy terms in search query

I currently have a search query set up that only displays the post_type of listings in the search results, I want to amend this query to include a custom taxonomy also. I have a custom taxonomy for ...
1
vote
1answer
49 views

Search - Ajax - Alter Query Parameters with Pagination

Too Long ; Didn't Read How do I get pagination to work when I'm creating my query with ajax? I'm working on creating a functional search page that allows the user to filter how many posts per ...
0
votes
0answers
16 views

Custom search result

I've tried to google it for several time but i couldnt find anything clear. I added a select field in the searchform.php, but if the user choose one of the options, i dont know how to show it on the ...
0
votes
0answers
21 views

Search (Custom Form, Custom Search Result)

If I have a form: <form class="search" action="<?php echo site_url(); ?>/page-search?category=2" method="get"> <input type="text" required name="search" placeholder="Search"> ...
0
votes
1answer
28 views

Wildcard search in WP Query

I am trying to do something like this: $args = array( 'post_type' => 'product', 'meta_query' => array( array( 'key' => 'custom-text-field', 'value' => '%rocket%', ...
0
votes
1answer
57 views

Custom post type blog pagination conflict

I have a custom post type called 'emp_case-studies' and it has a page archive. Here is the code for archive-emp_case-studies.php: <?php $blog = $wp_query; $wp_query= null; $args= null; ...
2
votes
1answer
117 views

How to make a WP_Query search with custom post types?

I've registered a custom post type called "node". When I create a basic WP_Query to get posts of that type, it works just fine. Example: $args = array( 'post_status' => 'publish', 'post_type' ...
0
votes
0answers
16 views

WP_Query For Custom Author and Single CPT Search?

I have created a search page where users can search the site with these options: (1) Keyword (2) Keyword in/from 12 different Custom Post Types (CPT's) (3) Keyword in/by a single Author's posts ...
0
votes
0answers
63 views

Using WP_Query IN pre_get_posts while searching

This is a continuation on this question. What I'm trying to do, is rerun a search query, to loop through it and index the taxonomy counts (so I can make some kind of facet search). What I do is this ...
0
votes
1answer
26 views

Ignore image urls in wp_query search

I'm doing a keyword search using wp_query as so: $wp_query = new WP_Query( 's=' . $_GET['s'] ); It is returning a post that has $_GET['s'] in one of its image URLs, and I don't want this to happen. ...
0
votes
1answer
74 views

Adding Custom Fields to Search

I'm trying to add custom fields to my search so that it can be refined by meta values. Currently I have added some select lists to my normal search: <form role="search" action="<?php echo ...
0
votes
2answers
70 views

Get a list of posts by specific category

I'm trying to build a search query in PHP in WordPress and I need to get all posts by a specific author in a specific category including drafts. For example, is it possible to do something like, ...
0
votes
1answer
126 views

Get custom wp_query search results to appear on search.php

I have a search.php page in my template which works fine when used with the native search widget, but I am making a search plugin which has a custom wp_query in it and I want those results to appear ...
0
votes
1answer
44 views

Custom filter for main search: how to exclude specific post_type from search results

Is there a way to use WP_Query's method, set(), in order to exclude a specific post_type from a global search. Here was my unsuccessful attempt: function _search_all($query) { ...
0
votes
0answers
37 views

How to create a custom search in wordpess matching with title and metadata

I want a custom search in wordpress where the search query should return results matching to post title or with a custom metadata. For example if a user is searching for "chicken" in my site, it ...
0
votes
3answers
289 views

Pagination broken when merging search results with additional WP_Query

On the search results page (search.php) I would like to perform an additional WP_Query to keep a specific order of search result types e.g. search results from authors should always be shown before ...
0
votes
1answer
73 views

Manipulating a query

I'm trying to use my own search form rather than default single-field form. So I made my fields and set the values to the query by using pre_get_posts hook. All things are well. Because of searching ...
0
votes
0answers
33 views

Change output of the function

Below is the Current Function function ajax_result($arg, $id,$pagenumber){ $apiclass = new ajaxwpqsfclass(); // The Query $query = new WP_Query( $arg ); $html =''; // The Loop ...
1
vote
1answer
116 views

Search Custom Post Type with all meta attached?

I'm currently have a search box that's supposed to search a certain post type. It's supposed to check the query against all standard cpt content, tags and the associated meta data. I'm wondering how I ...
0
votes
0answers
24 views

Search by child posts parameters, results as parent post

Let me give you a quick abstract explanation of what I need: 'Cars' is custom post type. Each car has a user associated with it (by custom field). Each user might have more than one car. Visitors are ...
0
votes
1answer
121 views

Why does Wordpress search returns same number of results for every search query?

I am hitting a brick wall, I am searching something on a site I am building and on every search it returns 10 results when I know in the index in relevanssi it shows more for the term I am searching ...
0
votes
1answer
713 views

Custom category search box for WordPress

I've seen plugins that add an additional drop down list of categories to the standard WordPress search bar, however this doesn't really help me at all. My site has a lot of posts in a lot of ...
0
votes
2answers
1k views

Pagination wont work with search results template [duplicate]

I can't seem to get pagination to work correctly in my search results template. The page links appear, but when i click onto page 2, it gives me a 404 error. Search.php <?php global $wp_query; ...
1
vote
0answers
350 views

Custom WP_Query for WordPress Search Results with meta_query

I am using a custom query to generate my search results. The code I am using works perfectly without the meta_query variables in my arguments array. I am trying to compare multiple custom fields with ...
0
votes
0answers
81 views

Creating Advanced Search with text & Dropdowns [duplicate]

I am working to develop an advanced search option. Where there will be fields: Text input Field (Post Title) Dropdown (it will be a taxonomy) Dropdown (it will be a taxonomy) Basically I need ...
0
votes
1answer
297 views

How does Show Posts based on a keyword search work in WP_Query

I am wondering how the search go through by defining 's' parameter in WP_Query. For example if I have a post assigned to "East" term in taxonomy "Direction", the post didn't mention any "East" or ...
1
vote
2answers
126 views

Trying to find a way to query post like normal search would do. within search.php page

I have a costume search in a site i am making. When a user search a certain term, i want to display category list with a count of how many posts are found with in that category. I thought of a way ...
0
votes
2answers
230 views

Custom search: Search posts but display parent page in results

I'm using Wordpress 3.5.1 with a modified twentytwelve theme. My main site structure is based on the Smooth Slider plugin (jQuery Cycle). I have Pages that contain only a shortcode (for example, ...
0
votes
1answer
1k views

Custom Search Result Page displaying only 1 result.

I'm trying to build a custom search results page. The problem I'm running into is that when I enter a search term ; say 'gaming', it will only return one result, being the latest result. I have my ...
0
votes
1answer
399 views

Wordpress search exact match

I have a few search filters set up and I found a few posts that shouldn't be in the search results. On looking into it further I found these posts match 'part' of the keyword. For example, searching ...
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 ...
4
votes
1answer
102 views

Tracing the life of a query

I can't find documentation regarding this - but is there a way to see how a query might bounce around from one filter to another? I've got a list of possible wp_filters and their relevance but I ...
0
votes
1answer
141 views

Can I make a search query which includes a space?

I want to search via WP_Query for the test "hello " including the last trailing space. Is this possible and if so, how do I do this?
1
vote
1answer
791 views

Post_count only shows the number of results per page

I have a wp_query $wp_query = new WP_Query($args); but for some reason the $wp_query->post_count only shows the amount of posts on each page. So if I set 'showposts' => '10' and 12 results are ...
0
votes
1answer
93 views

Query posts by custom fields

I am making a theme for a hotel, and I need to be able to provide functionality to search by the following custom fields: Location and Price. I need to be able to query them from the query string ...
0
votes
2answers
119 views

Search Page Returns Nothing

I'm currently working on this website and a test shows that the search page isn't working properly. Every time someone searches for something, it comes up blank. The code for the search page is as ...
0
votes
1answer
298 views

Multiple keyword search

I have a custom search where I want to enter a keyword or phrase into the search box, and then by pressing enter it adds it to a 'search storage' (already coded, see below). Asume I have 3 posts, one ...
0
votes
1answer
603 views

Custom search form with empty parameters

I'm building a custom search form with keywords and drop down lists (categories, date, and country (have a separate plugin for this)). In the searchform.php I have the input field and then ...
1
vote
1answer
483 views

Advanced search form with filters for custom taxonomies

I'm trying to build a complex search form with filters for several custom taxonomies, a search terms input and a select for the number of items displayed / page. The question has been posted before ...
5
votes
1answer
1k views

AJAX search on post pages by custom post type

I'm having an issue creating an ajax search on my single post pages. I need to limit the search results to the custom post types "fod_videos" and "post" and category 12. My issue is the search is ...
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
2answers
817 views

How Do I Use WP_Query to Run This Database Query as Search Result?

I have created a search box with a drop down box of 4 options to customize the search: A general default search, no filter A custom search according to the post title for a custom post type only. A ...
3
votes
1answer
133 views

BP Multi Network & Members Directory

With bp-multi-network it appears members are shared across all networks. Example - networks based on location. newyork.mydomain.com, losangeles.mydomain.com, vancouver.mydomain.com At present a ...
1
vote
2answers
2k views

How do I use wp_query for WordPress search?

I would like to create a custom search form to search posts based on the values of about 4 custom fields. I tried using wp_query to achieve this but so far my biggest problem is that the I don't get ...
0
votes
2answers
769 views

How to filter a static post page with ajax and $wp_query

I'm at a loss, I've found several unanswered questions related to this one. I have a static post page which has a search form in the sidebar. What I want to happen is to type in a keyword and then ...
0
votes
2answers
639 views

using pre_get_posts for search results not found

function hotlinkers_wp_query($query) { if ( !$query->is_admin && $query->is_search) { $search_query = str_replace('-',' ', $query->query_vars['s']); ...
1
vote
1answer
498 views

Including Custom Meta with posts_where query

I have been looking around to see how to do this but the solutions i've found don't seem to be working for me. I'm making an AJAX powered search for some wordpress custom post types. I have got ...