• Resolved tonedru

    (@tonedru)


    I have an image in my header but i can’t figure out how to make that image link back to a different web page.
    In the header.php i added the image then put this coding:

    <a href="http://www.elkforge.com"><img src="http://events-sugarhouse.com/website/wp-content/uploads/2011/09/Button-back-to-Elk-Forge.jpg" style="float:left;" />

    The image shows up just fine, but the link doesn’t work.

    any help??

    Thanks!
    ToneDru

    [Please post code snippets between backticks or use the code button.]

Viewing 15 replies - 1 through 15 (of 18 total)
  • You’re missing a closing </a> at the end of that code snippet. I would also strongly recommend that you add an alt text attribute to the link indicating where it is linking to.

    Thread Starter tonedru

    (@tonedru)

    So it should look like this?
    <a href="http://www.elkforge.com"><img src="http://events-sugarhouse.com/website/wp-content/uploads/2011/09/Button-back-to-Elk-Forge.jpg" style="float:left;" /></a>

    [Please post code snippets between backticks or use the code button.]

    because that doesn’t seem to work πŸ™

    You can check it out at events-sugarhouse.com/website

    Also how do I add an alt text attribute?

    Thanks!!!

    Yes it does. The central logo is a link.

    Thread Starter tonedru

    (@tonedru)

    It’s the image on the left that I’m trying to be a link. The one in the center already did that as part of the theme….

    There’s no image or text in that left hand link.

    Thread Starter tonedru

    (@tonedru)

    I’m not sure I understand what you mean by that.

    The link is empty. There’s no image markup or anything.

    Thread Starter tonedru

    (@tonedru)

    I don’t quite get what you’re referring to… i think you’re talking a little over my head there… The image in the header that says “back to elkforge.com” I want to be a link. but when i edit the header.php file it doesn’t seem to work.

    Can you please post a link to the site in question?

    Thread Starter tonedru

    (@tonedru)

    Your header div is overlaying the image link. Try placing a header image link inside the header div.

    Thread Starter tonedru

    (@tonedru)

    I think you lost me again, but here’s the coding around the image that I’m trying to work with, hope it will help:

    [Code moderated as per the Forum Rules. Please use the pastebin]

    Thread Starter tonedru

    (@tonedru)

    that didn’t post properly, maybe this will work?

    [Code moderated as per the Forum Rules. Please use the pastebin]

    You need to move your image link into the header div in header.php and then adjust your CSS to suit.

    Thread Starter tonedru

    (@tonedru)

    Do you mean to move the image link here?:

    <div id="container">
    		<div id="header" class="clearfix">
    <a href="http://www.elkforge.com" title="Elk Forge Bed and Breakfast"><img src="http://events-sugarhouse.com/website/wp-content/uploads/2011/09/Button-back-to-Elk-Forge.jpg" style="float:left;" /></a>
    			<a href="<?php bloginfo('url'); ?>">
    				<?php $logo = (get_option('chameleon_logo') <> '') ? get_option('chameleon_logo') : get_bloginfo('template_directory').'/images/logo.png'; ?>
    				<img src="<?php echo $logo; ?>" alt="Chameleon Logo" id="logo"/>

    And I’m not sure how to adjust the css accordingly… here’s the code for the header in css, i think:

    #header { position: relative; padding:30px 35px 3px; }
    		#logo {position: relative;left: 80px;}
    		p#slogan { float: left; font-size: 13.5px; color: #66929c; text-transform: uppercase; padding-top: 27px; margin-left: 0px; }
    		ul#top-menu { float: right; padding-top: 30px; }
Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘How to add link to image in header’ is closed to new replies.