• Resolved stellamaris5

    (@stellamaris5)


    when I am asked to insert stuff into the <head> section, where does this actually go?

    basically I have used this tool https://realfavicongenerator.net/ to generate a favicon package, it is asking me to unzip it to the root of my website and the to insert the code into the head section. If you follow the process you wil see what I mean, not sure how to do it…

    Where is the root of the website in therms of the WP install and where (what file do I need insert the the code in?

    I have used the favicon upload in the Customizr section but it doesnt generate one for all devices.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You should put this in your child-theme functions.php:

    add_action('after_setup_theme', 'replace_favicon');
    function replace_favicon(){
      if (method_exists('TC_header_main', 'tc_favicon_display') ){
        remove_action('wp_head', array(TC_header_main::$instance, 'tc_favicon_display') );
        add_action('wp_head', 'my_favicon');
      }
    }
    function my_favicon(){
    ?>
      <link rel="apple-touch-icon" sizes="57x57" href="/apple-touch-icon-57x57.png">
      <link rel="apple-touch-icon" sizes="60x60" href="/apple-touch-icon-60x60.png">
      <link rel="apple-touch-icon" sizes="72x72" href="/apple-touch-icon-72x72.png">
      <link rel="apple-touch-icon" sizes="76x76" href="/apple-touch-icon-76x76.png">
      <link rel="apple-touch-icon" sizes="114x114" href="/apple-touch-icon-114x114.png">
      <link rel="apple-touch-icon" sizes="120x120" href="/apple-touch-icon-120x120.png">
      <link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon-144x144.png">
      <link rel="apple-touch-icon" sizes="152x152" href="/apple-touch-icon-152x152.png">
      <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon-180x180.png">
      <link rel="icon" type="image/png" href="/favicon-32x32.png" sizes="32x32">
      <link rel="icon" type="image/png" href="/android-chrome-192x192.png" sizes="192x192">
      <link rel="icon" type="image/png" href="/favicon-96x96.png" sizes="96x96">
      <link rel="icon" type="image/png" href="/favicon-16x16.png" sizes="16x16">
      <link rel="manifest" href="/manifest.json">
      <meta name="msapplication-TileColor" content="#da532c">
      <meta name="msapplication-TileImage" content="/mstile-144x144.png">
      <meta name="theme-color" content="#ffffff">
    <?php
    }

    then you need to change the hrefs with the correct path.
    The correct path is where you uploaded the icons png files.

    Hope this helps.

    Thread Starter stellamaris5

    (@stellamaris5)

    thanks for this, I am ok with the root as it is set up in the code above. where would this be in the WP install.

    Is this straight into the /public_html folder or below?

    Thread Starter stellamaris5

    (@stellamaris5)

    also. some of you filenames don’t match the downloaded files I received from the website above?

    Thread Starter stellamaris5

    (@stellamaris5)

    resolved

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘inserting stuff into the section’ is closed to new replies.