Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Customizing Suggested phrases layout › Reply To: Customizing Suggested phrases layout
November 24, 2015 at 7:35 pm
#6755
Hi!
There is no option for that, but here is a filter I quickly put together:
add_filter("asp_results", "asp_top_keywords");
function asp_top_keywords( $results, $id ) {
$count = 20; // How many keywords?
if ( !isset($results['nores']) ) return $results;
global $wpdb;
$keywords = array();
$_keywords = $wpdb->get_results("
SELECT keyword FROM ".$wpdb->base_prefix."ajaxsearchpro_statistics
ORDER BY num desc LIMIT " . $count, ARRAY_A);
foreach($_keywords as $k=>$v) {
$keywords[] = $v['keyword'];
}
$results['keywords'] = $keywords;
return $results;
}
Add this to the functions.php file in your active themes folder. Before using this, don’t forget to turn on the search statistics on the Search Statistics submenu. It will not work without it.
Best,Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)



