Closed mayeenulislam closed 5 years ago
Currently with NanoSupport v0.2.2
the knowledgebase cannot be searched separately from site search.
But the site search works well with NanoSupport knowledgebase.
You can test at the following link (the site search is at the bottom of the page): http://dev.nanodesignsbd.com/knowledgebase/ (P.S.: the demo link might change anytime, because it's a dev. environment)
A system in under development and currently at a promising state to let the user search Knowledgebase separately. InshALLAH we will unveil very soon.
I use DIVI theme, but seem like the wordpress search bar can not even search the knowledge base post. I see in the demo site, you add a search bar in the bottom, may I ask that how to do that?
@fang-yu We second to the issue. Because from NanoSupport core the Knowledgebase entries are searchable.
It might be your theme that is prohibiting exhibiting any other Custom Post Type to appear on the search result. In that case what we can suggest is to tweak the search result with the pre_get_posts
hook:
<?php
function tweaking_mytheme_search_result( $query ) {
if( is_admin() ) return;
if( is_search() && $query->is_main_query() ) {
$query->set('post_type', 'nanodoc');
}
}
add_action( 'pre_get_posts', 'tweaking_mytheme_search_result' );
Source: WordPress StackExchange by tormorten
Thanks. But n order to do so, do you mean that I could add the following code to the functions.php in my theme folder ?
<?php
function tweaking_mytheme_search_result( $query ) {
if( is_admin() ) return;
if( is_search() && $query->is_main_query() ) {
$query->set('post_type', 'nanodoc');
}
}
add_action( 'pre_get_posts', 'tweaking_mytheme_search_result' );
Yes, not in the parent theme, but in your child theme's functions.php
so that theme update won't wash the code away.
We are glad to announce the first Premium Add-on for NanoSupport:
Requires NanoSupport v0.6.0
It will suggest from the Knowledgebase Docs while submitting a new ticket, and it will enable a separate search feature in Knowledgebase. 😃
Chris from ibousa.org asked: