• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Favicon

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Favicon

This topic is: not resolved

Tagged: Favicon

  • This topic has 23 replies, 8 voices, and was last updated 12 years, 10 months ago by burnettsboards.
Viewing 20 posts - 1 through 20 (of 24 total)
1 2 →
  • Author
    Posts
  • May 14, 2013 at 11:44 pm #40952
    Stefani
    Member

    Hi there!  I did a search in the forum for topics on the favicon, but I don't see where the Genesis favicon is located in order to change it.  If someone could guide me as to where it is, I'd greatly appreciate it.  Thanks so much!

     

    Stefani 🙂

    May 15, 2013 at 12:12 am #40953
    essaysnark
    Participant

    Here's how to load it from wp-content/images:

    http://www.briangardner.com/code/load-custom-favicon/

    May 15, 2013 at 7:41 am #40983
    Stefani
    Member

    GREAT!  Thank you!!

    May 15, 2013 at 7:48 am #40986
    Stefani
    Member

    Do I add ALL of the code?

    <?php
    
    // Load custom favicon
    add_filter( 'genesis_pre_load_favicon', 'custom_favicon_filter' );
    function custom_favicon_filter( $favicon_url ) {
    	return 'http://www.mydomain.com/wp-content/images/favicon.ico';
    }
    
    Or just this part:
    
    
    add_filter( 'genesis_pre_load_favicon', 'custom_favicon_filter' );
    function custom_favicon_filter( $favicon_url ) {
    	return 'http://www.mydomain.com/wp-content/images/favicon.ico';
    }
    May 15, 2013 at 7:59 am #40990
    essaysnark
    Participant

    Good question!

    Don't include the php part, since your functions.php file will already have that at the top.

    The line that begins with // is a comment so you can include that.

    So, here's what to include:

    // Load custom favicon
    add_filter( 'genesis_pre_load_favicon', 'custom_favicon_filter' );
    function custom_favicon_filter( $favicon_url ) {
    return 'http://www.mydomain.com/wp-content/images/favicon.ico';
    }
    

    If you have never edited one of these files before, then first, MAKE SURE YOU HAVE ACCESS TO YOUR SERVER VIA FTP (have your login credentials and instructions handy). And, create a backup of your existing file (before you make changes), so that you can restore it, in case something goes wrong. The easiest way to do that is simply Ctrl+A (on a PC) to select the whole thing, then Ctrl+C to copy it, then paste it into Notepad or Wordpad and save it as a plain-text file.

    The reason for these precautions is that a tiny error in functions.php can cause the whole site to go down, which is a scary thing indeed - but very easy to fix if you have these pieces ready. (Hope I don't freak you out with all this - it's not a big deal to make these changes, you just want to be prepared!)

    If you get stuck just let us know!

    May 15, 2013 at 8:02 am #40991
    essaysnark
    Participant

    PS: The code snippet is only showing up in the fancy colors here as a way to show what each part is doing - green for comments, yellow for variable names, etc. - it's obviously going to be just plain text (black) when you paste it into your functions.php file.

    May 15, 2013 at 5:54 pm #41086
    Stefani
    Member

    Cool!  thanks so much!

    May 15, 2013 at 6:00 pm #41087
    Stefani
    Member

    Woooohooo!  It worked...and it's the cutest little favicon ever!  THANK YOU!

    June 21, 2013 at 3:48 am #47004
    seanct
    Member

    Where about in the functions.php file would you load this code?

    June 21, 2013 at 5:34 am #47010
    essaysnark
    Participant

    @seanct, you can place that code anywhere in functions.php. However, if you're not familiar with editing this file, then be VERY careful: One small typo can bring down your whole site. Be sure to take a backup of the file before editing, and have your FTP login instructions on hand so that you can restore it to the server if something goes wrong.

    June 21, 2013 at 8:59 am #47039
    seanct
    Member

    Thanks so much, I'll definitely make a back up just in case 🙂

    June 24, 2013 at 7:27 am #47450
    seanct
    Member

    Ok so I tried adding the code in at the very end of functions.php and that didn't work. Before I try again, does the image need to be named favicon.ico ?

    And how exactly would I get an image to end in .ico?

    Kind regards

    Sean

    June 24, 2013 at 7:41 am #47453
    essaysnark
    Participant

    Hi Sean - yes it needs to specifically be an ICO file, named favicon.ico. You can create it in a graphics program - here's how:

    http://codex.wordpress.org/Creating_a_Favicon

    June 25, 2013 at 2:10 pm #47699
    ChristinaP
    Member

    So I just tried this and blew up my site. I deleted the code out of the functions.php file after it stopped working and saved it again and it's giving the same error. I have restored the file (wp-content/themes/news/functions.php), and even ended up renaming the News and Genesis folders and uploading them again fresh. Same error, I can't even get to my site or the admin page.

    Parse error: syntax error, unexpected ';', expecting ')' in /home/content/t/y/l/tyleralex/html/kidfriendlymanitoba/blog/wp-content/themes/news/functions.php on line 111

    Any idea on what to do to fix this? My site is kidfriendlymanitoba.com

    thanks so much! One of the reasons I chose this theme was because of this forum and I do have some coding background, it's been years but I usually can figure things out.

    June 25, 2013 at 2:18 pm #47701
    ChristinaP
    Member

    ok, ignore that. i did something to fix it

    June 25, 2013 at 2:50 pm #47707
    essaysnark
    Participant

    So you got it working now?

    June 25, 2013 at 2:55 pm #47709
    ChristinaP
    Member

    I did! I reinstalled the functions.php file one more time and my site is working now. I should just walk away when I mess things up.

    I don't have the favicon changed though.

    June 25, 2013 at 3:02 pm #47713
    essaysnark
    Participant

    Well congrats on getting everything back to what it was! That alone can be a major accomplishment - I've been through that panic myself plenty of times. 🙂

    On the favicon, it's hard to tell what the problem was from the info you provided but based on the error, I'm wondering if it's possible that you inserted the code in the middle of another function? Make sure you scroll to the very end of functions.php and insert the new code there.

    Also, you need to insert it as plain text - sometimes, copying from the browser can introduce problems (HTML characters and fancy quotes). To avoid that, you can select and copy it from this page (be sure to get the entire block of code) then paste it into a text editor - NotePad on the PC or TextEdit on Mac. Then, select it from there and copy/paste into your WordPress file.

    If you did all that and it's still not working, you can try posting the functions.php to http://pastebin.com/ and link to it here so we can check it out.

    June 25, 2013 at 5:26 pm #47734
    ChristinaP
    Member

    I think I did insert it in a function, I thought I was scrolled all the way down but noticed the bracket or something when I deleted the code. Now I'm a little afraid to try again 😛
    I was using Arthemia by ColorLabs and they just had a spot to upload the favicon, it was so much easier!

    June 25, 2013 at 6:05 pm #47736
    Bill Murray
    Member

    I think the function is a bit of overkill for most users. The real purpose of the function is if you want to use what I'll call a non-standard favicon location or filename.

    In your childtheme's images folder, you should see a file named favicon.ico.

    If you replace that file with the favicon you created with the same name, no code is necessary (at least not that last time I checked ...).

    Hope that helps.


    Web: https://wpperform.com or Twitter: @wpperform

    We do managed WordPress hosting.

  • Author
    Posts
Viewing 20 posts - 1 through 20 (of 24 total)
1 2 →
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble