WordPress.org

Support

Support » Themes and Templates » Add logo (header)

Add logo (header)

Viewing 5 replies - 1 through 5 (of 5 total)
  • Michael

    @alchymyth

    Forum Moderator

    without any clear information what your problem actually is:

    use an absolute file path to the logo image;

    try for example:

    <img src="<?php echo get_stylesheet_directory_uri(); ?>/images/logo.png" alt="KK Brainchild" />

    http://codex.wordpress.org/Function_Reference/get_stylesheet_directory_uri

    Thanks you…
    And yes thats what I did. I added this code to my header.php but nothing appears on the website … ?? why ??

    Michael

    @alchymyth

    Forum Moderator

    please post a link to your site to illustrate the problem.

    what is the exact problem?
    does the logo image show? or not?
    and if, does it show on all pages? or what?

    where is your logo image saved?


    you have two lines with ‘logo’ in your header code:

    <a>"><img src="/images/logo.png" alt="KK Brainchild" /></a></div>

    (this is broken, because you did not mark the code when you were posting it)
    this has a relative image url and might therefore fail.

    and:

    <h1 style=โ€display:none;โ€><img src="/images/logo.png" title="Home" alt="KK Brainchild" /></h1>

    two problems here:
    – the ‘squint’ double quotes (from copy/paste from a text source) which should be style="display:none;"
    and the relative path again.

    kkbrainchild.hostingsociety.com/wordpress
    – I tried to post it but it didn’t work. However.

    The problem is that even after adding the code

    <div id="logo">
    <h1><a href="<?php echo get_option('home'); ?>/"><img src="<?php echo get_option('home'); ?>/wordpress/wp-content/themes/KK Brainchild Theme/images/logo.png" title="Return to Home." alt="IMAGE TEXT." height="20" width="80" /></a></h1>
    <span><?php bloginfo('description'); ?></span>
    </div>

    to the header.php anyway nothing appears on the site…
    Why?

    My header.php looks like this

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
    <head profile="http://gmpg.org/xfn/11">
    <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
    <title><?php if (is_home () ) { bloginfo('name'); } elseif ( is_category() ) { single_cat_title(); echo ' - ' ; bloginfo('name'); }
     elseif (is_single() ) { single_post_title(); }
     elseif (is_page() ) { bloginfo('name'); echo ': '; single_post_title(); }
     else { wp_title('',true); } ?></title>
    <script type="text/javascript" src="<?php bloginfo('template_url'); ?>/script.js"></script>
    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
    <!--[if IE 6]><link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/style.ie6.css" type="text/css" media="screen" />
    <![endif]-->
    <!--[if IE 7]><link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/style.ie7.css" type="text/css" media="screen" />
    <![endif]-->
    <link rel="alternate" type="application/rss+xml" title="<?php printf(__('%s RSS Feed', 'kubrick'), get_bloginfo('name')); ?>" href="<?php bloginfo('rss2_url'); ?>" />
    <link rel="alternate" type="application/atom+xml" title="<?php printf(__('%s Atom Feed', 'kubrick'), get_bloginfo('name')); ?>" href="<?php bloginfo('atom_url'); ?>" />
    <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
    
    <?php wp_head(); ?>
    </head>
    
    ----------------------------------------
    <div id="logo">
    <h1><a href="<?php echo get_option('home'); ?>/"><img src="<?php echo get_option('home'); ?>/wordpress/wp-content/themes/KK Brainchild Theme/images/logo.png" title="Return to Home." alt="IMAGE TEXT." height="20" width="80" /></a></h1>
    <span><?php bloginfo('description'); ?></span>
    </div>
    -----------------------------------------
    
    <body>
    
    <div class="wrapper">
    <div class="logo">
    <a href="<?php bloginfo('url');?>"><img src="/images/logo.png" alt="KK Brainchild" /></a></div>
    			<?php /* if (is_home()) echo( '<h1 id="title">'); else echo( '<div id="title">');?><a href="<?php bloginfo( 'url'); ?>"><?php bloginfo( 'name'); ?></a><?php if (is_home()) echo( '</h1>'); else echo( '</div>'); */?>
    
        <div id="art-page-background-gradient"></div>
    <div id="art-page-background-glare">
        <div id="art-page-background-glare-image"></div>
    </div>
    <div id="art-main">
    <div class="art-Sheet">
        <div class="art-Sheet-tl"></div>
        <div class="art-Sheet-tr"></div>
        <div class="art-Sheet-bl"></div>
        <div class="art-Sheet-br"></div>
        <div class="art-Sheet-tc"></div>
        <div class="art-Sheet-bc"></div>
        <div class="art-Sheet-cl"></div>
        <div class="art-Sheet-cr"></div>
        <div class="art-Sheet-cc"></div>
        <div class="art-Sheet-body">
    <div class="art-nav">
    	<div class="l"></div>
    	<div class="r"></div>
    	<ul class="art-menu">
    		<?php art_menu_items(); ?>
    	</ul>
    </div>
    <div class="art-Header">
        <div class="art-Header-jpeg"></div>
        <?php if ( function_exists( 'meteor_slideshow' ) ) { meteor_slideshow(); } ?>
    
            	<div style="position: absolute; width: 270px; height: 259px; z-index: 1; left: 618px; top: 74px" id="capa1">
    
    <a target="_blank" href="#"><img border="0" src="<?php bloginfo('template_url'); ?>/images/ad1.png" width="125" height="125"></a>
    <a target="_blank" href="#"><img border="0" src="<?php bloginfo('template_url'); ?>/images/ad2.png" width="125" height="125"></a>
    <a target="_blank" href="#"><img border="0" src="<?php bloginfo('template_url'); ?>/images/ad3.png" width="125" height="125"></a>
    <a target="_blank" href="#"><img border="0" src="<?php bloginfo('template_url'); ?>/images/ad4.png" width="125" height="125"></a>
    
    </div>
    
    </div>

    So I thought the image would be shown but … yeah, nothing.
    Thanks for helping ๐Ÿ˜€

    you have two lines with ‘logo’ in your header code:

    “><img src=”/images/logo.png” alt=”KK Brainchild” /></div>
    (this is broken, because you did not mark the code when you were posting it)
    this has a relative image url and might therefore fail.

    …. so what I can do?!

    and:

    <h1 style=โ€display:none;โ€><img src=”/images/logo.png” title=”Home” alt=”KK Brainchild” /></h1>
    two problems here:
    – the ‘squint’ double quotes (from copy/paste from a text source) which should be style=”display:none;”
    and the relative path again.

    …. so how it has to look like?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Add logo (header)’ is closed to new replies.
Skip to toolbar