Questions tagged [search]

The method by which users find information on your WordPress site

Filter by
Sorted by
Tagged with
0
votes
0answers
5 views

How to tell a query is a category in wp_query class

I want to make ajax search form. and want to tel that query is cateory or not: $query = new WP_Query($args); if ($query->is_category){ echo 'this query is a category'; }
0
votes
0answers
6 views

Search custom posts by meta key in admin

I want the wordpress search in the custom post admin to include searching on a meta key not just the post title. I have the below which works for searching the meta key. But it stops the search on ...
0
votes
0answers
26 views

Ajax action has 200 status but response of No response data available for this request

I'm developing a custom plugin that implements an ajax-powered search form on a WordPress site. It runs a WordPress query and outputs the results just below the search box where a user types their ...
0
votes
1answer
25 views

How can i add to a existing wp query

Basically what I would like to achieve is I am building a property site and would like to build a custom search form that will search for tags and show products relating to the tags selected. Do I ...
0
votes
0answers
13 views

How to track searches using the REST API?

I'm using the WP REST API to have real time searches on my website using JavaScript but I still want to track those searches. I'm using a plugin called Search Analytics and it tracks searches in the ...
0
votes
0answers
11 views

Wordpress search on a custom table

I have set up a custom table in my WP DB and have it all working in the admin backend of WP with WP_List_Table where I can edit and add new entries perfectly. I have now moved on to the front-end side ...
1
vote
0answers
12 views

How can i preserve wordpress database encoding after using wp-cli search-replace with --export flag?

I need to migrate a wordpress database to another server but first i need to change all old url's, stored inside any table, to new ones. To do that, i'm using wp-cli search-replace function with --...
0
votes
0answers
9 views

Search & column order by meta value in admin

So, my posts have a custom field named "company" and I would like to have a sortable column for this field in the admin area list of posts and also be able to search posts by it's content. I'...
1
vote
0answers
27 views

wp_query 's', search filter with pagination is not working

I made this shortcode for a page of posts. I want to set a search function. I filled for example: "web design". The search-result will set in the var "$catSearched". Then it works ...
0
votes
1answer
37 views

Search function does not work on mobile devices

briefly about me: I took a working student job in my university with no WordPress experience (but my professor knows that). I basically maintain my professor's website. My predecessor wrote the ...
0
votes
1answer
35 views

Build A Custom SQL Query for WordPress Search

I was working on a code, where I used SQL to find something on my site. I realised that the SQL was giving me far accurate search results, and wanted to implement the same in my WordPress search query....
0
votes
1answer
20 views

Should I create a parent page with no content? [closed]

From an SEO perspective, should I ever have a blank parent page on my website?
0
votes
0answers
26 views

Exclude certain Gutenberg blocks from search results

I have a site that I have built using a series of ACF Gutenberg Blocks. The issue I have is when the search functionality is used. Searching obviously goes through the_content() to find appropriate ...
0
votes
1answer
18 views

Applying WP-cli Search & Replace to Static SQL Dump File

I have a wp db dump file inside my site directory. Can someone show me an example of how to use wp-cli search and replace command on the static sql file, not the active db to change my url from "...
0
votes
1answer
12 views

search: get minimum number of post for each post type

I've a small issue with the default search, I want to search cross different post_types and returning for example 5 items. In this moment if I search for the word: foo and this word is in 10 wc ...
0
votes
0answers
20 views

WC Fix Attributes - 'Add New' Not Searchable/Delayed

Installed the WC Fix Attributes plugin Version 1.0 | By Tofandel as found here: Slow Loading Attribute Select - WooCommerce Backend Works a charm and really speeds up searching existing attributes 10 ...
0
votes
1answer
24 views

Wordpress search in modified post title

I'm using the_title filter to add custom taxonomy name in front of my post (product) title. I would like to add this modified title to WP search query. Could someone help me with this topic?
0
votes
2answers
23 views

Include custom fields in search

I have a website with several custom fields, however when using the following code to search for a post, it only searches for the title or for the content, excluding the custom fields associated with ...
0
votes
1answer
17 views

Create a Search Form that only Searches with WooCommerce Sale Products

I am trying to create a search form that will search within products that are on sale/promotion within WooCommerce. Here is what I have so far: <form method="get" action="<?php ...
0
votes
0answers
18 views

Filter orders by modify date

I'm trying to add a new filter that will sort orders by modification date. Below is the code I found and modified. Unfortunately, filtering doesn't work, returns zero results.I think the problem is ...
0
votes
0answers
13 views

Wordpress Search function with partial and exact match

I want to modify the search function using pre_get_post or post_where to display results in three priority. Suppose keyword is : adam smith. I want first set of results to show the posts having the ...
0
votes
1answer
43 views

Return all Tags and Categories in Separate List

I am using the snippet below to create a shortcode to get all tags for a search in a separate list including tag count. Eg search for 'foo' and it returns all tags for all posts that match the search '...
0
votes
0answers
27 views

Integrate admin plugin into template. Very interesant (live search + autocomplete with wp rest api, in vanilla js)

I need a live search with wp rest api with autocomplete, in vanilla js. I found this plugin makes exacly what I needed. (I dont need this code as a plugin, its not a problem, but if it helps to make ...
0
votes
1answer
40 views

Using a new WP_Query inside the loop

I'm trying to query the database to count log entries for file downloads, this is then displayed an the thumbnail when listing search results. From Search.php ` <?php //JAYJAY Get the download ...
0
votes
0answers
12 views

How to add url parameter to every search query in SearchWp?

I have installed SearchWp plugin, and when I search something, for ex. "coffee" search query string is standard - ?s=coffee , and I need to add &post_type=product to every such string, ...
0
votes
1answer
31 views

Return All Tags from Search Result in Separate List

I am trying to create a list of tags on top of my search results page that returns all tags and tag count for all tags that are included in the search results. For example, I search for 'Foo' and it ...
0
votes
0answers
22 views

Filter search query to exclude postmeta value

In my wordpress site I am making use of the pre_get_posts filter to customise my site search query. In functions file I have the following below. Now my issue is, using FieldManager I have added a ...
0
votes
2answers
25 views

Adding overlay search to wordpress using add action/filter

I want to add custom overlay search to my WordPress site using add action. Somehow, it is not triggering the javascripts to show the overlay html. However, it is working in a browser when I test ...
0
votes
1answer
40 views

How to group search results by post type and only if post type result is not empty?

I want to group my search results to post types. I was able to do it by using foreach with an array of post types that I want but it also displays the ones that doesn't have any results. Here's my ...
1
vote
1answer
11 views

How to edit dashboard search posts button texts for my CPT?

I am new to WordPress Development. Can I change texts of filter search box button ?
1
vote
0answers
33 views

Make parts of your wordpress website completely built with data from external APIs?

I have experience with building frontends with react.js that use external data from RESTful APIs (from a headless CMS). Now I have someone ask me if I could build a wordpress website that has several ...
0
votes
1answer
18 views

How to change search page url so that it still returns a page when there's no search query specified?

I want to change the search url of WordPress. Instead of url.com/?s=searchterm I want to change it to url.com/search/searchterm or url.com/search?s=searchterm. On Google there's plenty of solutions ...
0
votes
0answers
20 views

Live search in admin page

I'm building a plugin that works only in admin. I've a page where the user choose some posts, the script generate a pdf file from this data and then it save in a specif folder. To help the user to ...
0
votes
0answers
23 views

Custom database table and custom search

On an existing site I am migrating from there is a csv file (about 5000 rows) and a Perl script that presents the user with a simple search form to display a selection of the fields on a search ...
0
votes
0answers
12 views

Advanced Wordpress Search with multi values of a single term

I have a custom field named Sizes , small, medium, large, extra large, so a given post may have multiple option selected for Size parameter, a user can select multiple options for a post from this ...
1
vote
0answers
13 views

Hi, I wanted to make custom search with multiple fields

I wanted to make custom search with multiple fields in which we have to filter by post title and with other custom fields and taxonomies. have a look on my code Form <form role="search" ...
1
vote
0answers
9 views

How to add seperate classes to no-search-result and found-search-result pages on wordrpess search - is_search()

I want to add seperate body classes for no search result and found search result pages on wordrpess search. I used that code but it isn't working - > what's the error here and what is the solution ...
0
votes
1answer
59 views

Include the post type before the title of search results

How can I add the 'Post Type' (Blog, Page) before the titles of search results? Post type: Title Example: Search results for "Potato" Blog: How to cook the perfect potato! Page: Sweet ...
0
votes
0answers
16 views

Load more posts on click

In my search.php I put this code <?php $args = [ 'orderby' => 'relevance', 'order' => 'DESC', 's' =&...
0
votes
1answer
11 views

Trying to get all links in my posts

I am trying to return all the links inside my posts'/pages' content, but I can't figure out how to get my regex/loop to work right. Here is what I have at the moment, that just returns a bunch of ...
1
vote
0answers
36 views

How can I use WP_Site_Query to find a blog by blog name?

WP_Site_Query accepts a search argument but if a search term or phrase is supplied, only the path and domain columns can be searched. The site_search_columns filter allows filtering of the columns to ...
0
votes
2answers
35 views

How to search order using database frontend short code WordPress

I do not have a lot of coding knowledge. How do I add a WordPress searching database shortcode to the frontend using the metavalue as if I were to search for "demo", the metavalue(named as ...
1
vote
1answer
37 views

How to do multiple searches (with logical OR) in WP_Query in hook pre_get_posts?

Example: $query->set('s', 'foo bar'); - search foo bar I want set search as foo bar OR lorem ipsum dolor OR ping pong
0
votes
0answers
30 views

Adding an HTML page to a wordpress website

I have a folder containing some images and an HTML file, and I'd like to find the easiest way to add this page to a Wordpress website. If I directly upload (via FTP) the folder on the website, how can ...
0
votes
1answer
49 views

Why isn't the 'no results' being shown when a query returns no results?

I've been following this tutorial for a simple AJAX filter search within wordpress: https://itsmereal.com/simple-ajax-filter-search-for-wordpress/?unapproved=3915&moderation-hash=...
0
votes
1answer
79 views

How to fetch Email addres of an author via ID?

I want to make an HTML form which will have an input field to fill in the ID of the user. Then I want to pass the value into a php code such that the email address associated with that user ID is ...
0
votes
1answer
36 views

Wordpress custom search form with pre_get_posts not work

I am designing my first theme and I am stuck on the search functionalities of a Custom Post Type. I created a CPT 'movies' and created the archive page with the 'archive-movies.php' file in the root ...
0
votes
1answer
30 views

How to order search results so a specific page appears first when user searches for a particular word?

I am trying to create a function that would give me a specific result order when the user inserts a specific word in the search bar. Example: The user inserts in the search bar "banana" and ...
0
votes
1answer
23 views

Add dynamic search to paginated WP_Query

I am currently displaying a list of pages with "words" (English learning site) using WP_Query. I want to add a search field at the top of the list, but in a way that would dynamically (is it ...
0
votes
0answers
37 views

How to make the WP query search for the "s" arg in other places too

By default, the WP query searches for the "s" arg in the post title, content and excerpt. How can I extend this and make it search in other places as well, such as author display name? ...

1
2 3 4 5
35