K2 theme header image link (4 posts)

  1. KarlEngstrom
    Posted 6 years ago #

    Hi All-

    First post here. New to Wp & I've been learning much from y'all... thought I'd toss my 2 cents in for starters.

    In currently working with the K2 theme I was stumped on how to get the header image (optional) to produce a link. What I did was the following & it seems to work.

    In header.php, line 48, change the line
    <div id="header" role="banner">
    <div id="header" role="banner" onclick="location.href='http://www.mydomain.com/';" style="cursor: pointer;">

    I found this code snip in http://codex.wordpress.org/Designing_Headers which made perfect sense. I was working late when I did this on a site I was tweaking so I haven't tested it thoroughly yet. It seems like the cleanest way to achieve the desired outcome. Please post if you have success with this or have a better method.


  2. alism
    Posted 6 years ago #

    Looks nice and clean to me. Suppose it wouldn't work on anything not running javascript though, which might be a downside depending on your audience.

    Hey, welcome to WordPress by the way! :-)

  3. Don Stratton
    Posted 5 years ago #

    Works for me! I did not have role="banner" in my header.php, so I tried it both ways and it seems to work just fine without it so I left it out. Thanks!

  4. williamberg
    Posted 5 years ago #

    This helped a lot. Thank you.

Topic Closed

This topic has been closed to new replies.

About this Topic