34 thoughts on “Hack: Adding a Logo to the Twenty Fifteen Theme”

  1. Thanks, this worked pretty well. Only time it doesn’t work so great is on a mobile device. The logo doesn’t scale down enough and looks too big. I wonder if there’s a way to have two versions of the logo, one for desktop displays and one for mobile devices? Thanks!

  2. Also, the “Title” for each page now shows “” on the browser window instead of the name of my site.

  3. Hey guys, thanks for the feedback! Iv’e seen the title tag issue only on the login page. Where else did you encounter this issue? Check the post update and modified code for the fix to the login page, and also for applying different sizes to the logo.

  4. Hello, thank you for the solution, it’s really the simplest ones I tried. But is it possible to keep the “Site Title” text in addition to the logo?
    Best regards.

  5. Hi Yaniv, I’ve used the update #2 and still the “” appears, albeit àfter the site title…

  6. Hi Stijn, I’m sorry to hear that. Do you encounter this issue all over the site, or only on specific pages? Try changing the following command – add_filter( ‘bloginfo’, ‘af_logo’, 10, 2 ); to add_filter( ‘bloginfo’, ‘af_logo’, 10000, 2 );

  7. Even with the modified code you’ve placed here, my site title is showing as img class=”af-logo . . etc..

    Please help! This fix is ALMOST perfect!

  8. Hi moshjosh, perhaps there is a plugin conflict even with my suggested fix – try deactivating your plugins and check if it works. Also, perhaps your theme doesn’t support this hack – try changing your theme to the Twenty Fifteen theme and check if it works.

  9. Unfortunately, still experiencing the same issue after changing the command and deactivating the plugins. Can we just keep the output for the logo & title in the sidebar and not in the site’s ?

  10. I’m seeing the same thing on every Page. They show the Page-Title and than <img class="af-logo" style=… and so on.
    Is there a way to fix this?

  11. I used your hack with “showing the title” and it works perfect. The only quibble I have is, that I get to see instead of the title of the website… Is there a solution without removing the whole hack?

  12. Hey guys, Iv’e created a fix for both PHP files. Sorry for the delay, and for some reason, having the Yoast SEO plugin solved this issue – I guess this is the reason why for some people the solution worked, and for some it didn’t.

    Let me know if everything is working well now. Thanks!

  13. Is there a way to center the logo when viewing on mobile devices? When the menu moves to the top on narrow devices the logo goes to the left.

  14. With WordPress 4.4.1 the solution broke yet again. My front page was wrong but every other page was correct. For my fix I needed to change the solution to 1 != $GLOBALS[‘yf_bloginfo_count’]

  15. Hello, I am looking for some help, I am trying to place a picture in the top right of my page I am using twenty fifteen. This is the code that is not working, not sure why, it was earlier until I delete pictures in my media and forgot that one of the pics I deleted was one I was using for the header.. But this is what I copied out of the editor,


    Not what happened.. I didn’t do anything other then copy and past the media url out of my media file in my wordpress blog.


  16. Same, here, changing that value I get logo on all pages, except front page or logo on front page and no logo on other pages.

  17. Hi Tomas, Iv’e installed a fresh WP + my snippet + Yoast SEO and the solution works fine for both the front page and posts (with the value of 1 == …). Maybe you have a conflicting plugin in place?

Comments are closed.