WordPress.org

Forums

Weather Underground
[resolved] Custom icons don't show (4 posts)

  1. chachalady
    Member
    Posted 1 year 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 1 year 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 1 year ago #

    Thanks chachalady, that helped me out. :)

  4. Ericka125
    Member
    Posted 1 year ago #

    That helped me too. Thanks!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Weather Underground
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic