Support » Fixing WordPress » Logo in title Position of TwentyTen Theme – not linking to home

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

    (@alchymyth)

    Forum Moderator

    please post a link to your site,
    and post the code(s) of your edited header section.

    thank you for the reply alchymyth.

    This is the detail of the site with the edits made to php and the css – although the css changes were just the removal of the lines above and below the image area.

    Website Link:
    http://www.islandvacationrentals.com/

    The headerphp code was changed as follows:
    Changed from:

    <<?php echo $heading_tag; ?> id="site-title">
     <span>
     <a href="<?php echo home_url( '/' ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>
     </span>
     </<?php echo $heading_tag; ?>>

    Changed to:

    <h1 id="site-title">
     <span>
     <a href="<?php bloginfo ('home');?>" rel="home" title="<?php bloginfo('name');?>">
     <img src="<?php echo bloginfo ('template_directory');?>/images/logo.png" alt="<?php bloginfo ('name');?>" />
     </a>
     </span>
     </h1><!--end of h1 site-title-->

    The css code was changed/edited as follows just to remove the lines:

    }
    #branding img {
    	border-top: none;
    	border-bottom: none;
    	display: block;
    	float: left;
    }

    (just editing the border-top and border-bottom from
    px to none.

    Jimii

    The link sorry is at: IslandVacationRentals.com

    The code for the other site – edited with pho header modifications – that does not hyperlink to the home page (but would like it to), was changed from this original code:

    <div id="header">
    		<div id="masthead">
    			<div id="branding" role="banner">
    				<?php $heading_tag = ( is_home() || is_front_page() ) ? 'h1' : 'div'; ?>
    				<<?php echo $heading_tag; ?> id="site-title">
    					<span>
    						<a href="<?php echo home_url( '/' ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>
    					</span>
    				</<?php echo $heading_tag; ?>>
    				<div id="site-description"><?php bloginfo( 'description' ); ?></div>
    
    				<?php

    to this modified code: (i substituted into this code example an artificial url as the site is in redevelopment on a temp url – actual is available but prefer not to public post it).

    <div id="header">
    			<div id="masthead">
    <div id="branding" role="banner">
    				<?php $heading_tag = ( is_home() || is_front_page() ) ? 'h1' : 'div'; ?>
    				<<?php echo $heading_tag; ?> id="site-title">
    					<span>
    <div id="logo"> <a href="<?php bloginfo('template directory'); ?>"><img src="http://ARTIFICIAL-TEMPORARY-URL.COM/wp-content/themes/mytwentyten/images/Site-Name-logo-75h.jpg" alt="SITE NAME"/></a></div>
    </span>
    			</<?php echo $heading_tag; ?>>
    				<div id="site-description"><?php bloginfo( 'description' ); ?></div>
    	<?php

    Any guidance on this is appreciated. thank you Jimii

    Michael

    (@alchymyth)

    Forum Moderator

    bloginfo('template directory') would link to your current WordPress theme’s folder (parent theme if you use a child theme);

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

    better use:
    http://codex.wordpress.org/Function_Reference/home_url

    try to replace this line:

    <div id="logo"> <a href="<?php bloginfo('template directory'); ?>"><img src="http://ARTIFICIAL-TEMPORARY-URL.COM/wp-content/themes/mytwentyten/images/Site-Name-logo-75h.jpg" alt="SITE NAME"/></a></div>

    for example with:

    <div id="logo"> <a href="<?php echo esc_url( home_url( '/' ) ); ?>"><img src="http://ARTIFICIAL-TEMPORARY-URL.COM/wp-content/themes/mytwentyten/images/Site-Name-logo-75h.jpg" alt="SITE NAME"/></a></div>

    alchymyth, thank you very much for this, I appreciate the guidance to the ref. articles and I’ve implemented your suggested corrections for both sites and it works just great. : )

    just marking as resolved

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Logo in title Position of TwentyTen Theme – not linking to home’ is closed to new replies.