Add extra metadata to <head> section

I've stumbled upon a web service which automates generation of various site icons (favicons) - https://epicfavicongenerator.com/

It works by generating 20 different site icons based on one upload (310 x 310). It includes basic favicon and more modern Apple and Windows (metro) icons. After successfully generating icons, it outputs the zip including all files and a code.txt with all <link rel=""> and <meta name=""> tags which are to be included inside the <head> section.

1. Is there a function that I could invoke in child theme's functions.php to add those meta tags? If so, please provide an example;
2. It might be an interesting addition to hooks section of BeTheme customization (I'm posting this suggesstion to suggestion thread too).

Comments

  • Hey,

    yes, it is possible. You can use standard hook in child theme. You can read more about this on http://codex.wordpress.org/Plugin_API/Action_Reference/wp_head

    Thanks!
  • edited March 2015
    In case anyone would be interested in adding code from epic favicon generator service, here's a snippet:

    /* CUSTOM ICONS */

    add_action('wp_head','my_custom_favicons');

    function my_custom_favicons()
    {
    echo "\n\n".''."\n";
    echo ''."\n";
    echo ''."\n";
    echo ''."\n";
    echo ''."\n";
    echo ''."\n";
    echo ''."\n";
    echo ''."\n";
    echo ''."\n";
    echo ''."\n";
    echo ''."\n";
    echo ''."\n";
    echo ''."\n";
    echo ''."\n";
    echo ''."\n";
    echo ''."\n";
    echo ''."\n";
    echo ''."\n";
    echo ''."\n";
    echo ''."\n";
    echo ''."\n";
    echo ''."\n";
    echo ''."\n";
    echo ''."\n"; }
    • echo prints each line inside <head>
    • remember to use single quote marks wherever there are double quote marks inside the string
    • use "\n" to force break lines
    • concatenate break lines with dot, ie "alpha".'beta'."gamma;
  • There's probably a more elegant way to do this, but hey - it works!
  • This is the only way to do this so we're glad to hear that it works :)
Sign In or Register to comment.