Reply To: How to display Blog name with each result item

Home Forums Product Support Forums Ajax Search Pro for WordPress Support How to display Blog name with each result item Reply To: How to display Blog name with each result item

#3039
Ernest Marcinko
Ernest Marcinko
Keymaster

Hi!

Ajax search pro offers numerous action and filter hooks. These hooks can be used to achieve such tasks. These actions/filters can be found in the actions.txt and filters.txt file. The asp_result_title_after_prostproc filter is what will possibly help.

Based on this knowledgebase article, I will try to implement some kind of solution: https://wp-dreams.com/knowledge-base/showing-the-post-type-name-in-post-title/

Try to paste this code to your themes functions.php file:


add_filter( "asp_result_title_after_prostproc", "asp_show_the_blog_title", 1, 1 );
 
function asp_show_the_blog_title( $title ) {
  $current_site = get_current_site();
  
  return $current_site->site_name . " - " . $title;
}

I have never tried this, but I think it will work.

Best,
Ernest Marcinko

If you like my products, don't forget to rate them on codecanyon :)