Adding a link to custom header on Studio theme

Hi,

I have recently purchased Studio and all is currently going well with the build.

What I want to do is add the custom header option below the theme menu and add a link to it. What I’m looking to do is sell the space to an advertiser.

I therefore need to somehow add a link to the image, could someone please describe how best to achieve this.

Thanks

Sped

custom-header.php (Studio theme)

<?php

/****
* Custom header image support. You can remove this entirely in a child theme by adding this line
* to your functions.php: define( 'BP_DTHEME_DISABLE_CUSTOM_HEADER', true );
*/
function bp_dtheme_add_custom_header_support() {
//$get_current_scheme = get_option('dev_wpplugins_custom_style');

$headerpath = "%s/library/styles/images/default_header.jpg";

/* Set the defaults for the custom header image (http://ryan.boren.me/2007/01/07/custom-image-header-api/) */

define( 'HEADER_TEXTCOLOR', '111111' );

define( 'HEADER_IMAGE', $headerpath ); // %s is theme dir uri
define( 'HEADER_IMAGE_WIDTH', 980 );
define( 'HEADER_IMAGE_HEIGHT', 100 );

function bp_dtheme_header_style() { ?>
<style type="text/css">
#headercustom { height: 100px; background-image: url(<?php header_image() ?>); }
<?php if ( 'blank' == get_header_textcolor() ) { ?>
#headercustom h1 a {display: none; }
#headercustom h1 a:visited {display: none; }
#headercustom h1 a:hover {display: none; }
<?php } else { ?>
#headercustom h1 a {color:#<?php header_textcolor() ?>;}
#headercustom h1 a:visited {color:#<?php header_textcolor() ?>;}
#headercustom h1 a:hover {color:#<?php header_textcolor() ?>;}
<?php } ?>
</style>
<?php
}

function bp_dtheme_admin_header_style() { ?>
<style type="text/css">
#headercustomimg {
position: relative;
color: #fff;
background: url(<?php header_image() ?>);
-moz-border-radius-bottomleft: 6px;
-webkit-border-bottom-left-radius: 6px;
-moz-border-radius-bottomright: 6px;
-webkit-border-bottom-right-radius: 6px;
margin-bottom: 20px;
height: 100px;
padding-top: 25px;
}

#headercustomimg h1{
position: absolute;
bottom: 15px;
left: 15px;
width: 44%;
margin: 0;
font-family: Arial, Tahoma, sans-serif;
}
#headercustomimg h1 a{
color:#<?php header_textcolor() ?>;
text-decoration: none;
border-bottom: none;
}
#headercustomimg #desc{
color:#<?php header_textcolor() ?>;
font-size:1em;
margin-top:-0.5em;
}

#desc {
display: none;
}

<?php if ( 'blank' == get_header_textcolor() ) { ?>
#headercustomimg h1, #headercustomimg #desc {
display: none;
}
#headercustomimg h1 a, #headercustomimg #desc {
color:#<?php echo HEADER_TEXTCOLOR ?>;
}
<?php } ?>
</style>
<?php
}
add_custom_image_header( 'bp_dtheme_header_style', 'bp_dtheme_admin_header_style' );
}
if ( !defined( 'BP_DTHEME_DISABLE_CUSTOM_HEADER' ) )
add_action( 'init', 'bp_dtheme_add_custom_header_support' );
?>

  • Timothy
    • Chief Pigeon

    Hey there.

    Can you please provide a screenshot with an arrow to demonstrate where exactly you would like to inject some code into the theme?

    Are you just wanting an image? Or do you have some ad based system to serve up the content and if so what’s the code for that?

    Thanks.

  • dasped
    • New Recruit

    Hi, sorry but can’t get a screenshot right now as I’m mobile. Image will be site based with am external URL.

    On the first theme option page, the first line, if memory server me well asks if you would like to use a custom header. Click yes and save. Refresh website and a light gray image appears at the top of the page just below the menu tabs and logo.

    I changed the image to suit my needs but simply wish to add a link. Thanks for any assistance you can give.

    I will provide screenshot if required but will not be home for a few hours to do so.

    Thanks again.

  • dasped
    • New Recruit

    OK, thanks for the file pointer Timothy, much appreciated.

    I added: onclick="location.href='http://www.advertdomain.com/';" style="cursor: pointer;"></div>

    <!-- start custom header section -->
    <div id="customheader-wrapper"><!-- start #customheader-wrapper -->
    <div id="customheader-holder"><!-- start #customheader-holder -->
    <div id="headercustom" onclick="location.href='http://www.advertdomain.com/';" style="cursor: pointer;"></div><!-- start #headercustom -->
    </div><!-- end #headercustom -->
    </div><!-- end #customheader-holder -->
    </div><!-- end #customheader-wrapper -->
    <!-- end custom header section -->

    Does this look OK to you? Seems to be working fine.

    Thanks

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.