WordPress.org

Ready to get started?Download WordPress

Forums

Clickable Header Image. Logo As External Link. (12 posts)

  1. Family Reflections
    Member
    Posted 4 years ago #

    Using the Minimalism Theme. I've replaced blog title and description with my custom logo. I'd like to make the logo clickable and for it to be a link to my home page.

    I've combed the threads on this topic and nothing has worked yet.

    Page:
    http://famreflections.com/blogs

    Code in header.php that you might want to know about:

    <div id="header">
     <div id="headerimg">
       <h1>
        </a><a>">
           <?php bloginfo('name'); ?></a>
       </h1>
         <div class="description">
           <?php bloginfo('description'); ?>
         </div>
      </div>
    </div>

    thank you for tolerating yet another one of these questions

  2. The original code should work, since you kept the original image name in CSS:

    <div id="header">
    	<div id="headerimg">
    		<h1>
                       <a href="<?php echo get_option('home'); ?>/">
                         <?php bloginfo('name'); ?></a>
                     </h1>
    		<div class="description">
                       <?php bloginfo('description'); ?>
    		</div>
    	</div>
    </div>
  3. Family Reflections
    Member
    Posted 4 years ago #

    Sorry, I replaced the code that I posted with the code you offered and nothing changed.

    I've sent new logo images to my ftp, thinking I might have a corrupted image file.

    I've tried to make the whole banner clickable to no avail.

    I've tried to make a transparent clickable box surrounding the image but the box wouldn't move or resize.

    Any other ideas?

  4. The wrong code still shows in your site's source; sure you put it in index.php, single.php and page.php?

    You've got some sort of combination of WordPress and an iWeb site going, with links going between both sites, some of which 404. You need to get that sorted out, too.

  5. Family Reflections
    Member
    Posted 4 years ago #

    Thank you for looking into it more deeply.

    I switched the code back after I tried it and I didn't see that it worked.

    Also the page and site are still under development, hence the broken links. And I'm building my site in iWeb and my blog sits in an iFrame. That full page is here: http://famreflections.com/Blog.htm

    I'll switch it back to your new code so you can take a look if you'd like.

  6. Family Reflections
    Member
    Posted 4 years ago #

    Anyone have any more ideas?

  7. Joni
    Member
    Posted 4 years ago #

    I use this in my sites, with the CSS calling the images for the banner, I put this in my header.php file:

    <div id="banner" onclick="window.location.href='http://www.yourdomain.com/'" style="cursor: pointer;"></div>

    Of course change the division to whatever division class or id calls your header/banner graphic, and substitute your own domain name.

  8. Family Reflections
    Member
    Posted 4 years ago #

    Thank you jonimueller, that's the closest I've gotten yet!

    If I wanted to make the link open in a new window (target="top") where would I add that in the above code. I've tried a few places and none worked yet.

    Also, this method seems to have moved my blog down away from the logo. Where would I go to edit the code necessary to bring the blog back up, snug under the logo.

    thanks again

  9. Family Reflections
    Member
    Posted 4 years ago #

    What would I insert into jonimueller's code to have the link open in a new window?

    And what do I edit to move the blog closer up underneath the banner?

  10. mhyd
    Member
    Posted 4 years ago #

    its not target="top" its target="_blank"

  11. josharris
    Member
    Posted 4 years ago #

    Where do you post that line of code within the header.php?
    Doesn't seem to work for me. I'm using WPFolio for my theme. Do I need to change "banner" or just the domain in the code?
    Thank you

  12. scooterschalk
    Member
    Posted 4 years ago #

    Hi, I also desperately lookinh for the answer to Family Reflections and josharris. The code below worked for me, but where do we add the target="_blank" in order for the link to open in a new window?

    <div style="banner" onclick="window.location.href='http://www.yourdomain.com/'" style="cursor: pointer;"></div>

Topic Closed

This topic has been closed to new replies.

About this Topic