Page 2 of 2 FirstFirst 12
Results 11 to 18 of 18
  1. #11
    Join Date
    Sep 2010
    Posts
    58
    Plugin Contributions
    0

    Default Re: adding link to header image

    Thanks Allen! It's really nice of you to offer and I do appreciate the help. The template I'm using is Twist of Nature, found HERE. My site doesn't look remotely like that due to all the customization but that is it. :)

  2. #12
    Join Date
    Sep 2009
    Posts
    14
    Plugin Contributions
    0

    Default Re: adding link to header image

    Greetings,

    I must admit that my coding skills are about non-existant; I know just enough to make some basic adjustments. However, I did find out why you couldn't find the suggested code and that is because of the switching code that your template uses to change header images from page to page; it replaced the code you would otherwise put the link in. Since the replacement code pushes the images themselves off to the CSS file, I don't think you can just stick a link in that part of the php file and make the whole header pic a link. However, if you don't mind using javascript, I found a possible solution. Try replacing this code in the tpl_header.php file:

    PHP Code:
    <!--bof-branding display-->
    <div id="<?php
    $page 
    $_GET['main_page'];
    $cPath $_GET['cPath'];
     if (
    $page == "index" && $cPath )
    { echo 
    "logoWrapper"; }
    else
    { echo 
    "logoWrapper".rand ); }
    ?>">
    with this:

    PHP Code:
    <!--bof-branding display-->
    <div id="<?php
    $page 
    $_GET['main_page'];
    $cPath $_GET['cPath'];
     if (
    $page == "index" && $cPath )
    { echo 
    "logoWrapper"; }
    else
    { echo 
    "logoWrapper".rand ); }
    ?>" onclick="location.href='http://www.gardenofshadows.ca';" style="cursor:pointer;">
    The only change is the javascript just before the very last '>'.

    As usual, make a copy of the original code before making these changes just in case it doesn't do what you want.

    By the by, I found the suggestion at: http://www.ajaxprojects.com/ajax/tut...php?itemid=223

    --Allen

    PS. the one downside that I can see is if people have JS turned off on their browsers, the link won't work.

  3. #13
    Join Date
    Sep 2010
    Posts
    58
    Plugin Contributions
    0

    Default Re: adding link to header image

    Hey Allen, it worked! Thanks so much for all the work you put into helping me. I really, really appreciate it. And if it doesn't work with JS turned off, no harm, no foul, right? It just remains status quo in that case. So, thanks again!

  4. #14
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: adding link to header image

    "Since the replacement code pushes the images themselves off to the CSS file, I don't think you can just stick a link in that part of the php file and make the whole header pic a link."

    Actually, you can just add back the link code - all the given code does is decide what classname the div will have. Put the link in just after the complete opening div tag:
    PHP Code:
    <!--bof-branding display-->
    <div id="<?php
    $page 
    $_GET['main_page'];
    $cPath $_GET['cPath'];
     if (
    $page == "index" && $cPath )
    { echo 
    "logoWrapper"; }
    else
    { echo 
    "logoWrapper".rand ); }
    ?>">

    <?php if (HEADER_SALES_TEXT != '' || (SHOW_BANNERS_GROUP_SET2 != '' && $banner zen_banner_exists('dynamic'SHOW_BANNERS_GROUP_SET2))) { ?>
        <div id="taglineWrapper">
    PHP Code:
    <!--bof-branding display-->
    <div id="<?php
    $page 
    $_GET['main_page'];
    $cPath $_GET['cPath'];
     if (
    $page == "index" && $cPath )
    { echo 
    "logoWrapper"; }
    else
    { echo 
    "logoWrapper".rand ); }
    ?>">

    <?php echo '<a href="' HTTP_SERVER DIR_WS_CATALOG '" id="logoLink">&nbsp;</a>'?>

    <?php if (HEADER_SALES_TEXT != '' || (SHOW_BANNERS_GROUP_SET2 != '' && $banner zen_banner_exists('dynamic'SHOW_BANNERS_GROUP_SET2))) { ?>
        <div id="taglineWrapper">
    Then add to your stylesheet

    #logoLink {display: block; height: 123px;}

    Adjust height to taste.

    There could be slight modifications to this depending on what elements you want to include in the background link area.
    Last edited by gjh42; 24 Jan 2011 at 04:39 PM.

  5. #15
    Join Date
    Sep 2009
    Posts
    14
    Plugin Contributions
    0

    Default Re: adding link to header image

    gjh42,

    Thanks for the info. I had thought of doing that. However, since the CSS code applies the background-image attribute to the div tag, would not adding the image code back into the php cause there to be two images and possibly defeat the classname-based image switcher since the 2nd image would be on top of the background image?

    --Allen

  6. #16
    Join Date
    Sep 2009
    Posts
    14
    Plugin Contributions
    0

    Default Re: adding link to header image

    Nyx1961,

    You are most welcome. I'm gratified that I was able to help.

    --Allen

  7. #17
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: adding link to header image

    Since the link is an empty <a> element (except for the no-break space in case IE gets picky), it will spread over the containing div transparently. It will not interfere in any way with the background switching. There is no image code added back in my example.

  8. #18
    Join Date
    Sep 2009
    Posts
    14
    Plugin Contributions
    0

    Default Re: adding link to header image

    gjh42,

    Ok. I get it now. My php ignorance was showing. Now that I look at it I do see that there is no code to insert an actual image.

    Thanks,

    --Allen

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. adding a link to header image
    By Steven Eserin in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 9 Jan 2013, 07:06 PM
  2. v151 Adding an image with link to header.
    By PetleyJ in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 30 Sep 2012, 09:50 PM
  3. Adding Additional Link to Header
    By Psykryph in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 25 Aug 2011, 08:39 AM
  4. Adding Link to Header
    By jhaydon in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 21 Apr 2011, 02:01 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg