Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › the option does not work
This topic contains 11 replies, has 2 voices, and was last updated by Ernest Marcinko 4 years, 2 months ago.
- AuthorPosts
- January 7, 2019 at 8:27 am #20653
the option does not work, I don´t want to see the url of the image, can you help me please?
January 7, 2019 at 9:30 am #20654Hi!
Thank you for the details, it helps me a lot!
I think you are looking at the wrong search instance options. Make sure to edit the search ID 1, where I see the description is still enabled. Turning that off will disable the content.
I hope this helps!
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
January 7, 2019 at 9:39 am #20655You cannot access this content.January 7, 2019 at 9:57 am #20657Hi,
It might be part of the WordPress generated excerpt from a shortcode or somathing. Try this configuration: https://i.imgur.com/U6zloZc.png
Best,
This will execute the shortcodes and use the content as the main field.
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
January 7, 2019 at 10:53 am #20658little by little it’s better
but now I want it to start with 200 characters and start with the first
January 7, 2019 at 5:35 pm #20663Hi,
The ‘Description context’ option is not for removing the first X characters from the results content. That is only possible via a custom code.
Try adding this custom code to the functions.php in your theme/child theme directory. Before editing, please make sure to have a full site back-up just in case! Change the $remove variable to the number of characters you want to remove.
Best,add_filter('asp_results', 'asp_remove_first_n_characters'); function asp_remove_first_n_characters($results) { $remove = 200; foreach ($results as $k => &$r) { if ( strlen($r->content) > $remove ) $r->content = substr($r->content, $remove); } return $results; }
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
January 8, 2019 at 10:48 am #20669Hi, I would need this script to do the function to hide some words, is that possible?
for example… my friend’s house is red
can I hide the word “house”?
it´s possible?
very thanks
January 8, 2019 at 1:40 pm #20681Hi,
Try this modified version of the code. Enter the keywords to be replaced to the $words variable, comma separated.
Best,add_filter('asp_results', 'asp_remove_first_n_characters'); function asp_remove_first_n_characters($results) { $remove = 200; // Enter the length to cut $words = 'word1, word2'; // Enter the words to replace // Replace the keywords $words = explode(',', $words); foreach ( $words as $wk => &$word ) { $word = trim($word); if ( $word != '' ) unset($words[$wk]); } if ( count($words) > 0 ) { // implode() words into a pipe-delimited string $pattern = "/\b(" . implode("|", $words) . ")\b/i"; foreach ($results as $k => &$r) { $r->content = preg_replace($pattern, "", $r->content); } } // Trim the length foreach ($results as $k => &$r) { if ( strlen($r->content) > $remove ) $r->content = substr($r->content, $remove); } return $results; }
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
January 9, 2019 at 7:44 am #20686last question, I have this example…
In my admin I have this configuration http://prntscr.com/m4r8ls
and my front end I have http://prntscr.com/m4r9mi
I need to look for me in the title of the post http://prntscr.com/m4rdsa
very thanks and I sorry for my English
January 9, 2019 at 12:59 pm #20690Hi!
I think that field ‘pyre_title_field’ is not the same as the post title, it does not contain the title, that is why it’s not working. The post title is not a custom field, that cannot be used for filtering.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
January 9, 2019 at 3:01 pm #20694and what solution would there be to be able to filter through the entry field?
January 10, 2019 at 12:12 pm #20698Hi,
The title field cannot be used for that, but maybe you could for example create a custom field with the data you need – copy there the title, or part of the title. Then use that for the filter, that should work.
Best,
Another possibility is to create a custom taxonomy.
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
- AuthorPosts
You must be logged in to reply to this topic.