Support » Plugins » Hacks » Custom header link image to attachment

  • Hi,

    I have installed a custom header in our new website’s theme, and added code so that it will link to whatever page that image is attached to. THis has worked in one instance (a category header), but not in the default custom header image.

    The code I have added is along the lines of:

    [ Moderator Note: Please post code or markup snippets between backticks or use the code button. ]

    <!--add custom header image-->
    <div><a>"><img src="<?php header_image(); ?>" height="<?php echo get_custom_header()->height; ?>" width="<?php echo get_custom_header()->width; ?>"  alt="The Free Ride Voice - True Independent Surf Journalism" class="custom_header" /></a></div>
    	</header><!-- /#header -->

    with the href php being the culprit in question.

    The URL is

    This website goes live tmrw for a surf comp.
    For now I have hardcoded the link URL, but this of course is affecting the one category header set so far as well, not ideal (

    The URL is

    Please help!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Jan Dembowski


    Brute Squad and Volunteer Moderator

    Generally speaking you would create a child theme, activate it, and then edit a copy of the header.php file in the child theme directory.

    Right now it looks like you are editing the original file and that will cause you grief when you update that theme.

    More specifically you are using a commercial theme and we do not support those here. Why not head over to the theme vendor’s support forum? Support from them was part of your purchase price.

    Since you’ve got it working for category pages it may not be a difficult thing to do. It’s just not something we can help you with here.

    Thanks Jan, will do

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom header link image to attachment’ is closed to new replies.