Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Josh Betz

    (@betzster)

    You could use a child theme to accomplish this: http://codex.wordpress.org/Child_Themes

    I did something a little different. I modified the code to look at a specific folder depending on the URL of the site. off of root WP folder I created a favicon folder with the FQDN names as subfolders. I then modified the code like this

    function network_favicon() {
      $ADVSite_URL = site_url();
      $ADVNSite_URL = network_site_url();
      $ADVFavIcon = $ADVNSite_URL.'favicon/'.trim($ADVSite_URL, 'http://');
      $ADVFavIcon2 = ABSPATH.'favicon/'.trim($ADVSite_URL, 'http://');
      $template = get_bloginfo('stylesheet_directory');
      $dir = get_stylesheet_directory();
      if( file_exists($ADVFavIcon2 . '/favicon.ico') ) {
        echo '<link rel="Shortcut Icon" type="image/x-icon" href="'.$ADVFavIcon.'/favicon.ico" />';
      } elseif( file_exists($ADVFavIcon2 . '/favicon.png') ) {
        echo '<link rel="Shortcut Icon" type="image/x-icon" href="'.$ADVFavIcon.'/favicon.png" />';
      } elseif( file_exists($ADVFavIcon2 . '/favicon.gif') ) {
        echo '<link rel="Shortcut Icon" type="image/x-icon" href="'.$ADVFavIcon.'/favicon.gif" />';
      }
    
    }

    I know ADV in the variable names… it’s something I got used to doing years ago to minimize stepping on other global variables. It has nothing to do with vanity 😉

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Network Favicons] Multiple sites, same theme?’ is closed to new replies.