• Resolved chachalady

    (@chachalady)


    Hello, I see that a few month ago someone had the same issue:topic about the same issue.

    The solution there
    $content = preg_replace('/http\:\/\/icons\-ak\.wxug\.com\/i\/c\/[a-z]\/(.*?)\.gif/ism', $myIconFolder.'$1'.$myFileType, $content);
    doesn’t work for me.

    So, today suddenly my custom icons were replaced with default.

    I have the filter at the bottom of my functions.php:

    add_filter('wp_wunderground_forecast_icon', 'use_custom_wunderground_icons');
    
    function use_custom_wunderground_icons($content=null) { 
    
        $myIconFolder = 'https://www.example.com/images/myicons';
    
        $myFileType = '.gif';
    
        $content = preg_replace('/http\:\/\/icons\-ecast\.wxug\.com\/i\/c\/[a-z]\/(.*?)\.gif/ism', $myIconFolder.'$1'.$myFileType, $content);
    
        return $content;
    }

    And today it doesn’t work for some reasen.

    Please help.

    https://www.ads-software.com/plugins/wunderground/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter chachalady

    (@chachalady)

    This is how I solve it after all – if anyone is having the same problem:

    first: in plugin settings I had to uncheck the “Cache forecast results”

    second: I had to replace this code in filter:
    $content = preg_replace('/http\:\/\/icons\-ecast\.wxug\.com\/i\/c\/[a-z]\/(.*?)\.gif/ism', $myIconFolder.'$1'.$myFileType, $content);

    with:
    $content = preg_replace('/http\:\/\/icons\-ak\.wxug\.com\/i\/c\/[a-z]\/(.*?)\.gif/ism', $myIconFolder.'$1'.$myFileType, $content);

    This solved the problem for me.

    Thanks chachalady, that helped me out. ??

    That helped me too. Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Custom icons don't show’ is closed to new replies.