WordPress.org

Ready to get started?Download WordPress

Forums

Weather Forecast - WP Wunderground
[resolved] Custom icons don't show (4 posts)

  1. chachalady
    Member
    Posted 9 months ago #

    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 = 'http://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.

    http://wordpress.org/plugins/wunderground/

  2. chachalady
    Member
    Posted 9 months ago #

    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.

  3. Toast
    Member
    Posted 9 months ago #

    Thanks chachalady, that helped me out. :)

  4. Ericka125
    Member
    Posted 8 months ago #

    That helped me too. Thanks!

Reply

You must log in to post.

About this Plugin

About this Topic