Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Previous script no longer working
This topic contains 3 replies, has 2 voices, and was last updated by Ernest Marcinko 5 years, 10 months ago.
- AuthorPosts
- January 18, 2018 at 12:27 pm #16369
Hi Ernest,
My website WordPress has updated to 4.7.9 and I placed this script you had previously gven me in the updated functions.php from line 2 onwards (see below) and it is now not working.
1.<?php
2./**
3.*Filter to remove ‘Supplier’ from Ajax Pro Search results display images
4.*/
5.add_filter(‘asp_results’, ‘asp_replace_supplier_name’, 10, 4);
6.function asp_replace_supplier_name($results, $sid, $is_ajax, $args) {
7.foreach ($results as $k=>&$r) {
8.$r->title = str_replace(‘supplier-‘, ”, $r->title);
9.}
10. return $results;
11.}
12./**
13. * Main WordPress API
14. *
15. * @package WordPress
16. */Thanks in advance.
January 18, 2018 at 4:25 pm #16381Hi!
The WordPress update should not have altered the theme functions.php file, and there was no change within the ‘asp_results’ filter, so this should still work.
Can you please add temporary back-end and FTP access so I can debug the ouput? Thank you!
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
January 19, 2018 at 3:50 pm #16412Hi Ernest,
My bad – I was trying to use the filter script in the main ‘functions.php’ file rather than the theme one!
The update had removed the previous version of the theme ‘functions.php’ file and I have now uploaded a modified file and all is well. I think it updated the previous version because I’m not using a child theme.
Thanks again.
January 19, 2018 at 5:42 pm #16416You cannot access this content. Best,
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.