WordPress.org

Ready to get started?Download WordPress

Forums

Twenty Fourteen
Replace Site Title with Image Logo (11 posts)

  1. Seastnan
    Member
    Posted 9 months ago #

    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

  2. WPMU DEV
    Member
    Posted 9 months ago #

    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,

  3. Guillermo
    Member
    Posted 8 months ago #

    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

  4. WPMU DEV
    Member
    Posted 8 months ago #

    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,

  5. Jas999
    Member
    Posted 8 months ago #

    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?

  6. WPMU DEV
    Member
    Posted 8 months ago #

    Hi @Jas999,

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

    Kind Regards,

  7. batharoy
    Member
    Posted 8 months ago #

    I believe there is now a solution in this thread.

  8. Jas999
    Member
    Posted 8 months ago #

    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!

  9. Jas999
    Member
    Posted 8 months ago #

    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.

  10. WPMU DEV
    Member
    Posted 8 months ago #

    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,

  11. Jas999
    Member
    Posted 7 months ago #

    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 .

Reply

You must log in to post.

About this Theme

About this Topic