Support » Theme: Twenty Fourteen » Replace Site Title with Image Logo

  • The client wants to replace the default site title with image inline with the menu the way it appears: they do not want their logo above the menu in the header.

    The original code in header.php is:

    <header id="masthead" class="site-header" role="banner">
    		<div class="header-main">
    			<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>

    I have replaced it with this code which is not working:

    <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><img src="http://client.com//wp-content/uploads/2013/12/logo.png" style="float: left;" alt="Logo" /></a></h1>

    I also tried adding the background url code to the logo in the CSS style sheet without success.

    What’s the solution?

    Thanks

Viewing 10 replies - 1 through 10 (of 10 total)
  • Hi @seastnan,

    The above code that you have added in header.php file of your theme and adding the background url code to the logo in the CSS style sheet should work for you.

    Can you share me your site link so that i can troubleshoot it?

    Best Regards,

    guillermovargasquisoboni

    (@guillermovargasquisoboni)

    Hello Seastnan,

    I tried your code and it works fine for me. Only one difference : I didn’t use double slash after the address (client.com), like you did. Maybe you just have to correct your path and erase one slash, in this way : http://client.com/wp-content/uploads… etcetera

    Hi @seastnan,

    As @guillermovargasquisoboni posted in his previous reply , you should correct the image path orelse it will display only “Logo” as an alternative text.

    Cheers,

    Hi all, I tried the above solution; although the logo now shows, the menu does not stick to the top of the page anymore, it dissapears as the user scrolls down. Is there a solution to remedy this?

    Hi @jas999,

    Could you please share me your site link so that i can troubleshoot it to provide you solution?

    Kind Regards,

    I believe there is now a solution in this thread.

    Hi, as batharoy says, there are solutions to incorporate a logo to the left of the main top menu in the thread he suggests:
    1- one makes changes in the header.php file
    2- and the other solution is purely css, adding code to style.css.
    But in my case, the menu does not remain fixed at the top of the web when a user scrolls down, no matter the solution I use. If I remove the css or remove the change in the header.php, the menu is now fixed at the top of the web page even when a user scrolls down.
    ->I thought it could be that my Fourteen version got corrupted. Redownloaded a fresh version. Did not correct.
    ->I was working locally on my PC (Windows 8.1, Firefox, WAMP, WP 3.8, no plugins activated). So I tried it on a test live web. Nope, did not correct, menu is not fixed.
    ->Could it be that I am using a French version of WordPress?
    I would gladly share you my link, providing you, WPMU DEV, provide me an e-mail I can send it to. Thanks in advance for your help!

    WORKS!!! The trick, for the header.php solution, is to use an image that is no more than 44px in height; under 44px, the menu is fixed, 45px and more, the menu is not fixed when a user scrolls.

    Hi @jas999,

    Awesome, great to see you got that fixed.

    If I can be of any further assistance please don’t hesitate to ask 🙂

    Cheers,

    Hi Seastna, can you please mark this as RESOLVED, well, I think it is as explained in the thread http://wordpress.org/support/topic/adding-logo-to-twenty-fourteen?replies=17 .

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Replace Site Title with Image Logo’ is closed to new replies.