WordPress.org

Ready to get started?Download WordPress

Forums

header links to homepage but search bar doesnt work anymore (8 posts)

  1. Michael Shedd
    Member
    Posted 4 years ago #

    i'm using the arras theme for my web site.

    i want to make my header link back to the homepage, but i've run into a problem with using the search bar. when users go to click on the search bar the page reloads before they have a chances to enter their search.

    i reverted back to the original header.php code and the search bar works fine again it's just the image doesnt link anymore. any suggestions?
    thanks!

    header link code:
    <div id="header" onclick="location.href='http://www.currentdose.com/';" style="cursor: pointer;">

  2. esmi
    Forum Moderator
    Posted 4 years ago #

    That code won't work properly because your search form is effectively part of your header. You'd need to to a lot more theme editing to make most of your header clickable without it impacting on your search bar.

  3. Michael Shedd
    Member
    Posted 4 years ago #

    can i make an image map?

    i used a program called gimp to come up with this:

    <map name="map">
    <!-- #$-:Image map file created by GIMP Image Map plug-in -->
    <!-- #$-:GIMP Image Map plug-in by Maurits Rijk -->
    <!-- #$-:Please do not edit lines starting with "#$" -->
    <!-- #$VERSION:2.3 -->
    <!-- #$AUTHOR:Christopher Shedd -->
    <area shape="poly" coords="109,0,108,236,759,236,760,185,978,186,1068,186,1067,0,1065,0" href="http://www.currentdose.com" />
    <area shape="rect" coords="66,0,100,171" href="http://www.elus1v.com" />
    </map>

    if i inserted this in the header tab
    <div id="header">
    (of course in the right place) would it work?

    thanks for the help

  4. esmi
    Forum Moderator
    Posted 4 years ago #

    I doubt that will work.

  5. Michael Shedd
    Member
    Posted 4 years ago #

    hmm alright thanks tho!

  6. esmi
    Forum Moderator
    Posted 4 years ago #

    What you need to do, as far as I can see, is insert another div block within the header and set its width to about 500px in your stylesheet and add the onlick function to this block instead. So something like:

    <div id="header">
    <div id="header_link" onclick="location.href='http://www.currentdose.com/';" style="cursor: pointer;">
    </div>

    Then in your stylesheet, add:

    #header_link{
    width:500px;
    height:237px;
    }

    I think that might work.

  7. Michael Shedd
    Member
    Posted 4 years ago #

    thanks esmi as always... u seem to always be super helpful i gave that a wing and nothing seemed to change. does it matter the placement in either of those files?

    in my header i tried adding this above then below the <div id="header"> in the header.php

    <div id="header">
    <div id="header_link" onclick="location.href='http://www.currentdose.com/';" style="cursor: pointer;">
    </div>

    i also replaced the <div id="header"> with <div id="header_link" onclick="location.href='http://www.currentdose.com/';" style="cursor: pointer;">

    as for the stylesheet portion i just threw it in the that file.

    nothing worked, but i'm not too great with the coding part of wordpress

  8. Michael Shedd
    Member
    Posted 4 years ago #

    well i didnt change it just didnt work... is what i should say. one time i had to header images and the second time i my original problem where i would click the search bar it would reload the page

Topic Closed

This topic has been closed to new replies.

About this Topic