Forum Replies Created
-
AuthorPosts
-
Ernest Marcinko
KeymasterOh I see, so It needs to add the “faq-item-” as prefix. Try this:
add_filter( 'asp_results', function ( $results, $id, $is_ajax, $args ) { if ( $id != 6 ) { return $results; } $to_hash = function ( $str ) { $str = preg_replace('/\s+/', '-', strtolower($str)); return preg_replace('/[^A-Za-z0-9\-]/', '', $str); }; // -- Do not change anything below -- foreach ( $results as $k => $r ) { $r->link = 'https://www.nevadainsuranceenrollment.com/questions-faq/health-insurance-faq/#faq-item-' . $to_hash($r->title); } return $results; }, 10, 4 );September 21, 2025 at 12:36 pm in reply to: Not able to replace default theme search with Ajax search pro #55513Ernest Marcinko
KeymasterHi Joel,
It greatly varies from theme to theme unfortunately. The default search form should be within the
searchform.php file in the theme directory. I recommend checking that first. If the theme search is in the header or footer, then sometimes they place it into theheader.phpforfooter.phpbut that is very rare.September 19, 2025 at 12:05 pm in reply to: Request to Modify Search Result Structure and Improve Performance #55509Ernest Marcinko
KeymasterYou cannot access this content.
Ernest Marcinko
KeymasterOh, that is a big shame. That basically means these URLs does not exist(?) and can’t be requested, probably generated on the frontend.
Still, there might be a hope to brute force it via converting the title to a hash, but I’m not sure:
add_filter( 'asp_results', function ( $results, $id, $is_ajax, $args ) { if ( $id != 6 ) { return $results; } $to_hash = function ( $str ) { $str = preg_replace('/\s+/', '-', strtolower($str)); return preg_replace('/[^A-Za-z0-9\-]/', '', $str); }; // -- Do not change anything below -- foreach ( $results as $k => $r ) { $r->link = 'https://www.nevadainsuranceenrollment.com/questions-faq/health-insurance-faq/#' . $to_hash($r->title); } return $results; }, 10, 4 );Try adding this code via the Code Snippets plugin or to the functions.php file in your theme/child theme directory – make sure to have a full server back-up first for safety. For more details you can check the safe coding guidelines.
Ernest Marcinko
KeymasterHi Nicolas,
Yes, of course! Use the asp_results hook for that. Within the results loop you can change the title, content and other fields, for example this.
Ernest Marcinko
KeymasterYou cannot access this content.
Ernest Marcinko
KeymasterYou cannot access this content.
Ernest Marcinko
KeymasterYou cannot access this content.
Ernest Marcinko
KeymasterYou cannot access this content.
September 18, 2025 at 8:40 am in reply to: Property search_options passed to constructor does not exist #55489Ernest Marcinko
KeymasterYou cannot access this content.
September 17, 2025 at 12:54 pm in reply to: Property search_options passed to constructor does not exist #55485Ernest Marcinko
KeymasterYou cannot access this content.
Ernest Marcinko
KeymasterYou cannot access this content.
Ernest Marcinko
KeymasterYou cannot access this content.
September 16, 2025 at 2:29 pm in reply to: Change filter setting background and unchecked default Post Types #55460Ernest Marcinko
KeymasterYou cannot access this content.
Ernest Marcinko
KeymasterYou cannot access this content.
-
AuthorPosts