Skip to main content

Questions tagged [search]

The method by which users find information on your WordPress site

6 votes
1 answer
8k views

Template issues getting ajax search results

I'm trying to put search results into a div with ajax. The issue is I'm getting errors saying undefined function have_posts() when the the search template is accessed. It also took issue with ...
Pollux Khafra's user avatar
39 votes
6 answers
61k views

Include custom taxonomy term in search

I have two custom taxonomies applied to two custom post types. the terms list on the sidebar just fine and will list all posts associated with it. However, if you search one of the terms in specific, ...
Norcross's user avatar
  • 3,077
29 votes
1 answer
30k views

how to limit search to post titles?

Is there a way to limit search to post titles? I know I can modify query.php core file but there must be a way to do it with hooks right? Thanks in advance!
Javier Villanueva's user avatar
13 votes
2 answers
61k views

Creating a search form for custom fields

I have built a theme for a car dealership. Each car is a custom post type ("vehicle"), and has about 12 custom fields with things such as Make, Model, Mileage, Fuel Type etc. etc. So basically on the ...
absdigital's user avatar
6 votes
2 answers
6k views

Exclude Specific Term from Search

It is possible to search for posts with a specific term by appending the URL with: ?&term=abc Is it possible to do the opposite and search excluding a specific term? Something like: ?&term=...
Rob's user avatar
  • 152
6 votes
2 answers
20k views

paginate_links() don't properly work in search.php?

I'm using this in my search.php template … <div class="pagination"> <?php echo get_pagination_links(); ?> </div> And this is the function … function get_pagination_links() { ...
mathiregister's user avatar
55 votes
8 answers
239k views

How to create a custom search for custom post type?

I have a search field for the blog posts, but I need an other for a custom post type. How can I create this custom search form with a different search result layout?
robert's user avatar
  • 567
51 votes
6 answers
39k views

Extending the search context in the admin list post screen

I have created a custom post type and have attached some custom fields to it. Now I would like to the search that authors can perform on the custom post list screen (in the admin backend) to also be ...
Stefano's user avatar
  • 1,261
32 votes
4 answers
71k views

Advanced search form with filters for custom taxonomies and custom fields

I'd like to build an advanced search form for a specific custom post type, having filters for the custom post types custom fields, custom taxonomies, and for a separate custom post types properties (...
pax's user avatar
  • 633
3 votes
3 answers
3k views

Sticky posts on home page, search, tag and archives without plugin

I have a question today. I am looking for a solution to make sticky post available on my website. But, i just got it work on homepage with the code below. function wpb_latest_sticky() { /* Get all ...
Jornes's user avatar
  • 753
40 votes
13 answers
103k views

Using meta query ('meta_query') with a search query ('s')

Trying to build a search that not only searches the defaults (title, content etc) but also a specific custom field. My current query: $args = array( 'post_type' => 'post', 's' => $query, ...
luke's user avatar
  • 649
21 votes
3 answers
26k views

How can I implement a location based (zip code) search in WordPress?

I am working on a local business directory site that will use custom post types for the business entries. One of the fields will be "Zip Code." How can I set up a location based search? I'd like ...
matt's user avatar
  • 1,652
15 votes
6 answers
39k views

How to search for (partial match) display names of WordPress users?

I need to create a search page that will display anything related to the supplied search. i.e. comments containing it, events, posts, CPTs and users with that name. How can I search for users in the ...
hannit cohen's user avatar
  • 1,521
5 votes
1 answer
2k views

Extending search query with additional $sentence value

Next in my quest to extend WordPress is altering how WordPress uses the the $sentence variable in posts_search to include an additional string, when the $sentence variable meets a certain criteria. ...
Zach's user avatar
  • 1,933
4 votes
2 answers
33k views

How do I search events between two set dates inside WP?

I am building a WP site with an events feature. The events page was made with custom post types. I want to make it possible for people to search/ filter events by dates. For example, they can search ...
Sosthenes Kwame Boame's user avatar

15 30 50 per page
1
2 3 4 5
12