Favicon

This topic is: not resolved

Tagged: 

This topic contains 23 replies, has 8 voices, and was last updated by  burnettsboards 1 year, 2 months ago.

Viewing 15 posts - 1 through 15 (of 24 total)
  • Author
    Posts
  • #40952

    stefiharr
    Participant
    Post count: 47

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

    #40953

    essaysnark
    Participant
    Post count: 342

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

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

    #40983

    stefiharr
    Participant
    Post count: 47

    GREAT!  Thank you!!

    #40986

    stefiharr
    Participant
    Post count: 47

    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';
    }
    #40990

    essaysnark
    Participant
    Post count: 342

    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:

    [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';
    }
    [/php]

    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!

    #40991

    essaysnark
    Participant
    Post count: 342

    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.

    #41086

    stefiharr
    Participant
    Post count: 47

    Cool!  thanks so much!

    #41087

    stefiharr
    Participant
    Post count: 47

    Woooohooo!  It worked…and it’s the cutest little favicon ever!  THANK YOU!

    #47004

    seanct
    Participant
    Post count: 3

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

    #47010

    essaysnark
    Participant
    Post count: 342

    @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.

    #47039

    seanct
    Participant
    Post count: 3

    Thanks so much, I’ll definitely make a back up just in case :)

    #47450

    seanct
    Participant
    Post count: 3

    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

    #47453

    essaysnark
    Participant
    Post count: 342

    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

    #47699

    ChristinaP
    Participant
    Post count: 4

    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.

    #47701

    ChristinaP
    Participant
    Post count: 4

    ok, ignore that. i did something to fix it

Viewing 15 posts - 1 through 15 (of 24 total)

You must be logged in to reply to this topic.