Previous script no longer working

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

 
Keymaster
4 years ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #16369

    Participant

    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.

    #16381

    Hi!

    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 :)


    #16412

    Participant

    Hi 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.

    #16416
    You cannot access this content. Best,
    Ernest Marcinko

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


Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.