in omnia paratus
Member
Posted 3 months ago #
Hi there,
I would like to know how can I display the search results on a specific page?
Also, I have multiple boxes (that are working trough a drop down plugin that shows more information as it opens) that are the target of the search. But when I have the search results, the title of this box appears but as a permalink, not has the intended box with its content. How can I fix it?
Tks
http://wordpress.org/extend/plugins/advance-wp-query-search-filter/
TC.K
Member
Plugin Author
Posted 3 months ago #
The plugin using your theme search.php template by default. So you can customize your search.php in order to fit your need.
Here is how have to do:
in the search.php while loop
if(wp_verify_nonce($query->query_vars['s'], 'awqsfsearch') ) //this will verify that the search is from the plugin
{
//here you can add your own style of your result.
}
else{
goto your default search result style.
}
thatwastaxing
Member
Posted 3 months ago #
Thanks! How do I use this if I have 2 different search forms based on 2 different CPTs that have different results templates for each?
thatwastaxing
Member
Posted 3 months ago #
Might it be possible to choose which template we want to use for the serch results in your next update? Thanks!
TC.K
Member
Plugin Author
Posted 3 months ago #
Hi,
How do I use this if I have 2 different search forms based on 2 different CPTs that have different results templates for each?
Well, it can. By just editing the code above:
if(wp_verify_nonce($query->query_vars['s'], 'awqsfsearch') ) //this will verify that the search is from the plugin
{
if($_GET['formid'] == '111'){
//template for your form with id = 111
}
if($_GET['formid'] == '222'){
//template for your form with id = 222
}
}
else{
goto your default search result style.
}
Might it be possible to choose which template we want to use for the serch results in your next update?
It is possible, but will be not included in near future. Depends on my workload and times.