WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Logo in header (11 posts)

  1. Crispian
    Member
    Posted 1 year ago #

    Hi there. I am struggling to figure out why I can't see my logo in the header section of the webpage. I can see it on the homepage but the second page there is just a blank space where the logo should be...Could it be that something is blocking it from showing? I just cant think what it can be.

    Anyone have ideas as to why this is not working?

    This is the code I used in the header.php file.

    <div id="logo"><img src="wp-content/themes/adlibitumensemble_/images/logo.png" width="400" height="159" /></div>

  2. Crispian
    Member
    Posted 1 year ago #

    Sorry wrong code. Here is the correct line of code...

    <div id="logo"><?php echo '<img src="wp-content/themes/adlibitumensemble_/images/logo.png" width="400" height="159" />'; ?></div>

  3. esmi
    Forum Moderator
    Posted 1 year ago #

    Always use full (absolute) urls in WordPress.

    <div id="logo"><img src="http://example.com/wp-content/themes/adlibitumensemble_/images/logo.png" width="400" height="159" /></div>

    Or even better (in a template file):

    <div id="logo"><img src="<?php echo get_stylesheet_directory_uri();?>/images/logo.png" width="400" height="159" /></div>

  4. Andrew
    Forum Moderator
    Posted 1 year ago #

    Are you missing the forward slash at the start of your image source url?

  5. Crispian
    Member
    Posted 1 year ago #

    @ Esmi Theme Diva & Forum Moderator

    I am currently building this website on localhost at the moment before I upload it online. it could be the reason why I cant see the logo. Thanks. I will keep in mind to use full urls.

    Will try your solution.

    @ Andrew

    You mean (Check bolded text) in the code

    <div id="logo"><?php echo '<img src="/wp-content/themes/adlibitumensemble_/images/logo.png" width="400" height="159" />'; ?></div>

  6. Crispian
    Member
    Posted 1 year ago #

    You mean the forward slash just after the <img src="/

  7. Andrew
    Forum Moderator
    Posted 1 year ago #

    Yes, that is what I mean. You may get a better long-term result with Esmi's recommended code, "Or even better".

  8. esmi
    Forum Moderator
    Posted 1 year ago #

    @ Esmi Theme Diva & Forum Moderator

    Gosh - the full title! ;-)

    Please try one or other of the suggestions I made above. Using relative urls anywhere within WordPress will always produce unpredictable results.

  9. Crispian
    Member
    Posted 1 year ago #

    Okay. Thanks Andrew. Will try this and see what goes

  10. Crispian
    Member
    Posted 1 year ago #

    Okay thanks Esmi

  11. Crispian
    Member
    Posted 1 year ago #

    Hi Esmi. It worked. Thanks for your help :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags