• Resolved Uneven_Blogger

    (@stephenallen28)


    Hi – I am trying to place a favicon into a twenty eleven child theme. I found this thread which took me all the way through the process, but then I reached a roadblock.

    I have an extremely basic functions.php file which looks like this:

    [ Moderator note: instead of using block quote use the backtick or the code button for PHP examples. ]

    <?php
    
    /* custom PHP functions below this line */
    
    ?>
    </blockquote>
    Then after that, I input the code to designate the favicon immediately after that, which looks like this:
    
    <blockquote>// add a favicon to your site
    function blog_favicon() {
    	echo '<link rel="Shortcut Icon" type="image/x-icon" href="'.get_bloginfo('stylesheet_directory').'/images/favicon.ico" />' . "\n";
    }
    add_action('wp_head', 'blog_favicon');

    I think that something must be missing from the functions.php file, because I notice that whenever I edit the file in the child theme, it will cause the site to either A) become completely inaccessible (404 message) or B) display other error messages.

    Right now, the first part of the Rev Voodoo’s code appears right above the header, but no favicon.

    Any thoughts about what the error might be?

    Any help would be greatly appreciated!!
    Stephen

Viewing 1 replies (of 1 total)
  • Thread Starter Uneven_Blogger

    (@stephenallen28)

    Solved my own problem – experimented by opening a php tag in front of RevVoodo’s code, so now the code looks like this, and everything works:

    [ Moderator note: instead of using block quote use the backtick or the code button for PHP examples. ]

    <?php // add a favicon to your site
    function blog_favicon() {
    echo '<link rel="Shortcut Icon" type="image/x-icon" href="'.get_bloginfo('stylesheet_directory').'/images/favicon.ico" />' . "\n";
    }
    add_action('wp_head', 'blog_favicon');
Viewing 1 replies (of 1 total)
  • The topic ‘Favicon in Twenty Eleven Child Theme’ is closed to new replies.