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.
This website uses cookies

We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you’ve provided to them or that they’ve collected from your use of their services.

Cookies are small text files that can be used by websites to make a user's experience more efficient.

The law states that we can store cookies on your device if they are strictly necessary for the operation of this site. For all other types of cookies we need your permission. This means that cookies which are categorized as necessary, are processed based on GDPR Art. 6 (1) (f). All other cookies, meaning those from the categories preferences and marketing, are processed based on GDPR Art. 6 (1) (a) GDPR.

This site uses different types of cookies. Some cookies are placed by third party services that appear on our pages.

You can at any time change or withdraw your consent from the Cookie Declaration on our website.

Learn more about who we are, how you can contact us and how we process personal data in our Privacy Policy.

Please state your consent ID and date when you contact us regarding your consent.