Timeline for Search not working with title and content
Current License: CC BY-SA 4.0
17 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Dec 16, 2019 at 19:38 | comment | added | Tom J Nowell♦ |
It can't be done by changing the stuff you pass to WP_Query , it requires custom code. Also you should edit your question, as the title of the question has nothing to do with your problem
|
|
Dec 16, 2019 at 18:51 | comment | added | Naren Verma | whatever I understand, I added in the question. So there is no way to solve this issue except plugin right? | |
Dec 16, 2019 at 14:55 | comment | added | Tom J Nowell♦ | I had a look, that Q belongs on this stack, not stackoverflow | |
Dec 16, 2019 at 5:26 | comment | added | Naren Verma | If you have a time then please check this answer. I tried from here stackoverflow.com/questions/59300576/… | |
Dec 16, 2019 at 3:49 | comment | added | Naren Verma | Actually, my boss doesn’t want it. And I already ask question search category and taxonomy and I tried that which is working but title and content search not working | |
Dec 16, 2019 at 0:53 | history | edited | Tom J Nowell♦ | CC BY-SA 4.0 |
added 369 characters in body
|
Dec 16, 2019 at 0:50 | comment | added | Tom J Nowell♦ | Is there a particular reason? Note that whatever you do will make your site slower, wether it's in a plugin or in the theme. The reason having lots of plugins makes you site slow isn't because plugins are slow, it's because doing more stuff takes more time. Eitherway you should ask a new question for how to search category and taxonomy terms, but keep in mind the answer will require basic/beginner programming skills, it would be much easier for you to find a plugin. WP search is not good, there's not much you can do to improve it | |
Dec 15, 2019 at 18:26 | comment | added | Naren Verma | I can't use a plugin that's the reason I tried from my side. | |
Dec 15, 2019 at 18:23 | comment | added | Tom J Nowell♦ | That's not how that works, if you want to extend the WP search functionality to search taxonomies you'll either need to install a plugin to do that, or, make extensive code changes. You can't do that by changing a parameter in the query | |
Dec 15, 2019 at 18:19 | comment | added | Naren Verma | Yes, I added inside the tax_query: because I have to search product by tag and category as well. so I thought. | |
Dec 15, 2019 at 18:17 | comment | added | Naren Verma | I need to know the answer so that i will understand where I am doing the mistake. I am trying to learn PHP and wordpress. | |
Dec 15, 2019 at 18:09 | comment | added | Tom J Nowell♦ | @NarenVerma I suspect you don't have a basic grasp of PHP? Note that I won't be adding a copy paste solution to my answer, a beginner level understanding of PHP is necessary to understand any answers you get here | |
Dec 15, 2019 at 18:08 | history | edited | Tom J Nowell♦ | CC BY-SA 4.0 |
added 438 characters in body
|
Dec 15, 2019 at 18:03 | comment | added | Naren Verma | Trust me I haven't understood your solution so I updated my code in the question. I am confused what code I have to use inside function | |
Dec 15, 2019 at 12:03 | comment | added | Tom J Nowell♦ |
@NarenVerma the second parameter is the same as what you would put in the arguments array. I won't update my answer with a copy pasta but beginner level PHP should be enough to figure out what goes in there ( it should be a simple copy paste operation ). Also, none of this will work as long as you still have the WP_Query loop in your template, it needs to be changed for a standard post loop
|
|
Dec 13, 2019 at 3:25 | comment | added | Naren Verma | Sorry for the late reply, @Tom, I added function.php search code. I need to know what code I have to use inside $q->set( 'tax_query', ....... ); ? | |
Dec 12, 2019 at 20:23 | history | answered | Tom J Nowell♦ | CC BY-SA 4.0 |