How to make clickable header image in BP Daily

How can I make the "custom image" in the header clickable?

I'm not sure where the "a href" code needs to be added to header.php

  • gregfielding

    http://housingstorm.com

    It would be easy (enough for me) if the header wasn't uploaded through the theme. It looks like the theme has a built-in homepage link with "logo" uploads, but not for a custom header image.

    Here's the code from header.php

    <?php locate_template( array( '/library/components/advert-header.php' ), true ); ?>
    <div id="logo">
    <?php
    $logo_on = get_option('dev_buddydaily_header_image');
    $logo_image = get_option('dev_buddydaily_header_logo');
    $description_on = get_option('dev_buddydaily_header_description_on');
    $description = get_option('dev_buddydaily_header_description');
    $square_logo = get_option('dev_buddydaily_header_image_square');
    $square_image = get_option('dev_buddydaily_header_logo_square');
    $site_title = get_option('dev_buddydaily_header_title');
    ?>
    <?php</p>
    <p> if($logo_on == "no" && $square_logo == "yes"){
    ?>
    " title="<?php _e( 'Home', 'buddypress' ) ?>"><img src="<?php echo $square_image; ?>" alt="<?php bloginfo('name'); ?>" class="logo-square"/>
    <h1 class="square-header">" title="<?php _e( 'Home', 'buddypress' ) ?>"><?php echo stripslashes($site_title); ?></h1>
    <?php
    }
    else if($logo_on == "yes" && $square_logo == "no"){
    ?>
    " title="<?php _e( 'Home', 'buddypress' ) ?>"><img src="<?php echo $logo_image; ?>" alt="<?php bloginfo('name'); ?>" class="full-logo"/>
    <?php
    }
    else{
    ?>
    <h1>" title="<?php _e( 'Home', 'buddypress' ) ?>"><?php echo stripslashes($site_title); ?></h1>
    <?php
    }</p>
    <p> ?>
    </div></p>
    <p>

  • Tammie

    @gregfielding: I can help just need to know what you want to do.

    1. Do you want to make the custom image header clickable?
    2. Do you want to make the logo clickable?

    I ask this as you will see in the code the logo is already clickable so assume 1?

    If that is the case you can't and have it be a custom header as it is because that is a background image you will note it uses a function attached to:

    <div id="header">

    This is linked to the function file custom-header.php under library/functions/

    In there you will see the custom image is a background image therefore you can't make it clickable.

    You can therefore to make this image clickable not use custom header or you can do your own custom edit for that function but I would adivse just don't use it and comment out in functions.php the following line:

    <br />
    require_once(DEVLIB . '/functions/custom-header.php');

    Then make sure your css styles for header are what you want as you may have to include a custom css style if not using the custom header.

    After that you can then just in the header bit remove any code between the header id tag and the closing id to be whatever you want. For instance:

    <div id="header"><br />
    			<?php locate_template( array( '/library/components/advert-header.php' ), true ); ?><br />
    				<div id="logo"><br />
    				<?php<br />
    					$logo_on = get_option('dev_buddydaily_header_image');<br />
    					$logo_image = get_option('dev_buddydaily_header_logo');<br />
    					$description_on = get_option('dev_buddydaily_header_description_on');<br />
    					$description = get_option('dev_buddydaily_header_description');<br />
    					$square_logo = get_option('dev_buddydaily_header_image_square');<br />
    					$square_image = get_option('dev_buddydaily_header_logo_square');<br />
    					$site_title = get_option('dev_buddydaily_header_title');<br />
    				?><br />
    				<?php</p>
    <p>				if($logo_on == "no" && $square_logo == "yes"){<br />
    					?><br />
    					<a>" title="<?php _e( 'Home', 'buddypress' ) ?>"><img src="<?php echo $square_image; ?>" alt="<?php bloginfo('name'); ?>" class="logo-square"/></a><br />
    					<h1 class="square-header"><a>" title="<?php _e( 'Home', 'buddypress' ) ?>"><?php echo stripslashes($site_title); ?></a></h1><br />
    				<?php<br />
    				}<br />
    				else if($logo_on == "yes" && $square_logo == "no"){<br />
    					?><br />
    					<a>" title="<?php _e( 'Home', 'buddypress' ) ?>"><img src="<?php echo $logo_image; ?>" alt="<?php bloginfo('name'); ?>" class="full-logo"/></a><br />
    				<?php<br />
    				}<br />
    				else{<br />
    				?><br />
    					<h1><a>" title="<?php _e( 'Home', 'buddypress' ) ?>"><?php echo stripslashes($site_title); ?></a></h1><br />
    				<?php<br />
    				}</p>
    <p>				?><br />
    			</div></p>
    <p>					<div class="clear"></div><br />
    		</div><!-- #header -->

    Can become:

    <div id="header"><br />
    		Whatever code you want your choice<br />
    		</div><!-- #header -->

    That should sort it up to you what you want to add there you will in this example loose the logo and advert though.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.