Insert code into header.php

  • Sandra
    Senior Member 265 points
    May 15, 2015 at 12:57 pm


    I have just learned how to create shortcut onto home screens of phones 🙂 and want to replace the icon used to my logo.

    I have done this for iPhones ok, following a tutorial, but for Android the tutorial said to insert the following code into the header of each page I want the icon to represent.

    <link rel=”apple-touch-icon” href=”/apple-touch-icon.png” />
    <link rel=”apple-touch-icon-precomposed” href=”/apple-touch-icon.png” />

    – See more at:

    So I want it to represent the homepage, so need to insert into the header.php file?

    I’d be very grateful if someone could explain HOW I do this, i.e.:

    Step 1: Open filezilla?
    Step 2: Open X folder
    Step 3: download X file
    Step 4: Paste the code “Here” etc. etc.

    As I don’t want to f-up by doing something really stupid that is obvious to everyone except silly old me:)

    Thanks guys.

  • Josh
    Super Guru 13,875 points
    May 18, 2015 at 3:44 pm

    Hello Sandra
    Step 1: Open filezilla,enter your ftp login details and click connect
    Step 2: Click edit on the file header.php (or you can download it edit it with an editor such as Dreamweaver,sublimetext,aptana studio or Notepad then upload it after Step 3)
    Step 3: Paste the code between the <head></head> tags click save (or upload if you did download it)

  • Janak
    Super Guru 1,283 points
    May 20, 2015 at 8:26 am

    @Sandra, if you don’t want to f-up and you’ve never used Filezilla before it may be wise to have a quick look at a tutorial on using it first. If you go to you’ll find info on how to use it and also install it if you don’t have it already.

  • Mark
    Titan 733 points
    May 20, 2015 at 10:14 am

    I don’t understand why would you want to do all that filezilla, editing and who knows what when you can simply use a plugin like this one:

    or this one:


    This reply was awarded the best answer by the topic poster.
  • Mark
    Titan 733 points
    May 20, 2015 at 10:27 am

    Other option to insert the meta code to your header (without the need for any file editing, plugins or filezilla) is to go to admin > Theme Options > Design Setup > Custom Metadata – and simply paste it into the ‘Header Styles (wp_head)’ section and save.

  • Sandra
    Senior Member 265 points
    May 29, 2015 at 11:19 pm

    Hi everyone thank you for your help.

    Josh, I tried 🙂 Not sure I was doing it in the right folder, I went into: pubic _html / wp content / themes / then into my theme folder and inputted the code in the header.php file inbetween the head tags, but didn’t work. So probably wasn’t the right folder ?

    Janak, thank you for your reply. I have used Filezilla a bit (to backup site and upload updated themes) but I have never edited a file and didn’t want to go somewhere I shouldn’t

    Mark, thank you for link to plugins, I didn’t want to use a plugin because they can effect the running of the site, but ended up using one so thank you.

    inputting it into the design area, meta data, didn’t work.

  • Josh
    Super Guru 13,875 points
    May 30, 2015 at 11:34 am


Viewing 7 posts - 1 through 7 (of 7 total)

New Business Themes for WordPress 2020

Start your new website today!

View Business Themes