WordPress.org

Forums

Storage Location for Icon (.ico) (9 posts)

  1. davejampole
    Member
    Posted 3 years ago #

    Hopefully this is the correct forum for this question. If not, let me know.

    I want to use an icon (.ico) with pages in a website. In an html-coded file, the icon must be at the same level as the html page(s), NOT in a different folder. The link to the icon would be: <link rel="icon" href= "icon.ico"> and must be in the <head></head> element of the page.

    Within WordPress, can someone tell me where the icon needs to be? I tried everywhere I can think of, with no success. It seems to me that this should be easier than it is.

    TIA

  2. Tim S
    Member
    Posted 3 years ago #

    Hi TIA,

    Notice in the code you posted it has the file path using the href tag. If you put it in the root folder, you just need to specify the correct path in the link.

  3. davejampole
    Member
    Posted 3 years ago #

    Tim,

    What I've looked at on the web suggested that .ico are being replaced by .png so I've converted the .ico to .png .

    I'm a little thick and I'm not sure what you are saying. Are you suggesting that I change the link to <link rel="icon" "icon.png">, excluding the "href"= . Currently the path to the WordPress webpage is: /public_html/wordpress/wp-content/themes/LCOC (LCOC being the domain), which is, as far as I can tell, the 'standard' pathing.

    Is it relevant that I'm adding the link in the LCOC header.php file?

    Dave (FYI - TIA=thanks in advance)

  4. Tim S
    Member
    Posted 3 years ago #

    hahaha,

    I'm slow so sorry about that. that's something I'm not aware of since png files are images whereas .ico files denotes it's the icon to be used. The LCOC file should be a theme folder, not the actual webpage. The page is being built from multiple objects. But here's the codex on favicons:

    http://codex.wordpress.org/Creating_a_Favicon

    I hope this helps!

  5. davejampole
    Member
    Posted 3 years ago #

    Here's what I did: in the header.php file, I included there two lines:

    <link rel="icon" "/images/favicon.png" />
    <link rel="icon" "/images/favicon.ico" />

    I opened my page in Firefox 10. The icon display, but I was curious which of the two did the trick, so I commented out the .png line - image display when page was loaded. Just to double check, I commented the .ico line (BOTH were commented out. When the page was reloaded the icon displayed. No way in hell should that work.

    Being exceptionally smart, I removed both lines from header.php, saved the file and when I reloaded the page, the icon displayed!!

    Added: it seems that having the favicon.ico in the /public_html/wordpress/wp-content/themes/domain_name folder does the trick, whether there is a link calling the icon in the header.php file or not.

    Don't know why, don't know how, but I ain't looking an alligator in the mouth. Chalk it up to computer magic.

    Tim, if you can figure this out, let me know.

  6. esmi
    Forum Moderator
    Posted 3 years ago #

    1.Never use relative paths in a WordPress theme or site. Stick to absolute urls only.

    2. Favicons are funny things and the way that servers and/or browsers cache them is even weirder. It can take days for any favicon change to show up on your site.

  7. davejampole
    Member
    Posted 3 years ago #

    It looks like the way a favicon is called in html is different than the way it is called in a WP file. What this means is that I'm in for a fun-filled ride transitioning from hand-coding in Dreamweaver to working in WordPress.

    I've never had the 'favicon change' delay you're talking about. I can make a change, [F5] the webpage in my browser and there it is.

    Oh, well. Life is full of surprises.

  8. esmi
    Forum Moderator
    Posted 3 years ago #

    It looks like the way a favicon is called in html is different than the way it is called in a WP file

    In what way?

  9. davejampole
    Member
    Posted 3 years ago #

    Maybe my favicon wasn't displaying because of the delay you alluded to in one of your earlier posts, but after waiting and fiddling around, it finally displayed and I attributed that to what I was doing, not the delay.

    Everything is working as needed now.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.