Community Forums › Forums › Archived Forums › General Discussion › Favicon
Tagged: Favicon
- This topic has 23 replies, 8 voices, and was last updated 11 years, 6 months ago by
burnettsboards.
-
AuthorPosts
-
May 14, 2013 at 11:44 pm #40952
Stefani
MemberHi 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 #40953essaysnark
ParticipantHere's how to load it from wp-content/images:
May 15, 2013 at 7:41 am #40983Stefani
MemberGREAT! Thank you!!
May 15, 2013 at 7:48 am #40986Stefani
MemberDo 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 #40990essaysnark
ParticipantGood 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 #40991essaysnark
ParticipantPS: 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 #41086Stefani
MemberCool! thanks so much!
May 15, 2013 at 6:00 pm #41087Stefani
MemberWoooohooo! It worked...and it's the cutest little favicon ever! THANK YOU!
June 21, 2013 at 3:48 am #47004seanct
MemberWhere about in the functions.php file would you load this code?
June 21, 2013 at 5:34 am #47010essaysnark
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 #47039seanct
MemberThanks so much, I'll definitely make a back up just in case 🙂
June 24, 2013 at 7:27 am #47450seanct
MemberOk 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 #47453essaysnark
ParticipantHi Sean - yes it needs to specifically be an ICO file, named favicon.ico. You can create it in a graphics program - here's how:
June 25, 2013 at 2:10 pm #47699ChristinaP
MemberSo 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 #47701ChristinaP
Memberok, ignore that. i did something to fix it
June 25, 2013 at 2:50 pm #47707essaysnark
ParticipantSo you got it working now?
June 25, 2013 at 2:55 pm #47709ChristinaP
MemberI 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 #47713essaysnark
ParticipantWell 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 #47734ChristinaP
MemberI 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 #47736Bill Murray
MemberI 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.
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.