WordPress.org

Ready to get started?Download WordPress

Forums

Network Favicons
[resolved] Multiple sites, same theme? (3 posts)

  1. quietcity
    Member
    Posted 1 year ago #

    Is there a way to specify different favicons for different sites that use the same theme?

    http://wordpress.org/extend/plugins/network-favicons/

  2. Josh Betz
    Member
    Plugin Author

    Posted 1 year ago #

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

  3. advail
    Member
    Posted 1 year ago #

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

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.