Jump to content
MakeWebGames

Recommended Posts

Posted

Re: How can you get a different Icon for your website?

Thanks I'll try that,

I couldn't click on the icon to find it's name lol

Do I upload that icon in to public_html?

As that is the public folder..

Posted

Re: How can you get a different Icon for your website?

upload the image to your public_html directory were your other files are kept make sure its called favicon.ico

 

and add this to your header

<link rel="icon" href="favicon.ico" type="image/vnd.microsoft.icon" />

  • 1 month later...
Posted

Re: How can you get a different Icon for your website?

 

upload the image to your public_html directory were your other files are kept make sure its called favicon.ico

 

and add this to your header

<link rel="icon" href="favicon.ico" type="image/vnd.microsoft.icon" />

if you wanted it to change like so its either icon 1 or icon 2 could you do that?

Posted

Re: How can you get a different Icon for your website?

simple way, and without complicating it too much

 

$foo = mt_rand(1,2);

($foo == 1 ? print '<link rel="icon" href="favicon1.ico" type="image/vnd.microsoft.icon" />' : print '<link rel="icon" href="favicon2.ico" type="image/vnd.microsoft.icon" />');

 

2 images. favicon1.ico and favicon2.ico

Put that in <head> part in header.php

Posted

Re: How can you get a different Icon for your website?

BD would it not be best to do...

 

$rand = mt_rand(1,2);
echo '<link rel="icon" href="favicon'.$rand.'.ico" type="image/vnd.microsoft.icon" />';

 

...???

Posted

Re: How can you get a different Icon for your website?

 

BD would it not be best to do...

 

$rand = mt_rand(1,2);
echo '<link rel="icon" href="favicon'.$rand.'.ico" type="image/vnd.microsoft.icon" />';

 

...???

Yeah, that'd be better, if your explicitly naming your favicons, favicon1 and favicon2. Though you could use your same idea, by adding the names of your favicons to an array, and using array_rand().

Posted

Re: How can you get a different Icon for your website?

You don't need to add any html to your pages to get the favicon to work, just upload it as favicon.ico in your public_html or httpdocs folder. At first you won't see the change because your cache is used to no favicon, but it will catch up.

Posted

Re: How can you get a different Icon for your website?

 

You don't need to add any html to your pages to get the favicon to work, just upload it as favicon.ico in your public_html or httpdocs folder. At first you won't see the change because your cache is used to no favicon, but it will catch up.

but that wouldnt change would it???

Posted

Re: How can you get a different Icon for your website?

Hawk Cronus is right - In IE it is not necessary to use any html tags at all. Internet Explorer will automatically look in the root directory for the favicon.ico file whenever a page is saved to favorites or is bookmarked... The tag is usually just used to either direct the favicon.ico path for those pages not in the root directory, or to use a custom image instead of the default favicon.ico. However there is a problem with this as when you bookmark the site it saves the favicon off in Temporary Internet Files and when you clear out the Temporary Internet Files, the favicon.ico will disappear. So I think it is just easier to add the html tags... thus then it will work on all browsers and will appear all the time.

"The code below will load a webpage icon to the address bar after clicking refresh or saving the site in the favorites."

<link rel="icon" href="http://www.whatever.com/myicon.ico" type="image/x-icon"/>

<link rel="shortcut icon" href="http://www.whatever.com/myicon.ico" type="image/x-icon"/>

 

$rand = mt_rand(1,2);
echo '<link rel="icon" href="favicon'.$rand.'.ico" type="image/vnd.microsoft.icon" />';

 

If you wish to use that then remember to explicitly name your favicons with 1 and 2 at the end of each name.

Posted

Re: How can you get a different Icon for your website?

On all the sites I have ever used I just replace the favicon.ico with my own, all browsers know to recognize it, however if you cant see it, it has to do with your pc, not necessarily the icon itself.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...