Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Kingsly

macrumors 68040
Original poster
Personally, I've given up on wordpress - I can bs my way through a pretty nice looking website with html and css in DW, but all this php business has my head spinning... :eek:

My wife's site has a header banner and for whatever reason this particular theme does not allow for the provision to make that header banner image a clickable "back to home" link. I've given it my all, and only managed to break the site over and over. Thank goodness for backups!

This is where I [think] i've narrowed the code relating to the image to be, in the header.php file:

Code:
<?php do_action( 'instamate_before_header' ); ?>
	<?php $header_image = get_header_image();?>
	<header id="branding" class="clearfix" role="banner"<?php if ( ! empty( $header_image ) ) { ?> style="background: url(http://www.starobryan.com/wp-content/uploads/2012/12/logo2.jpg) no-repeat top center;max-width: <?php echo get_custom_header()->width; ?>px; min-height: <?php echo get_custom_header()->height; ?>px;"<?php } ?>>
 

jsm4182

macrumors 6502
Apr 3, 2006
346
12
Beacon, NY
The way that header is being handled it makes it almost impossible to link it. The header image is a css background image. The site title is a clickable link as a should be in a Wordpress site, but is hidden with css.

I see a few ways it could be done.

  • Instead of having the image as a background of the header area, put the site title back in and put the image as a background on that.
  • Put the site title back in, position it over the image and use a negative indent to hide the text.
  • In the template put the image directly in the link replacing the text.
 

SrWebDeveloper

macrumors 68000
Dec 7, 2007
1,871
3
Alexandria, VA, USA
A cheap fix (noting the advice of jsm4182 is for far better long term solutions):

As your site uses jQuery:

Code:
$("header#branding").click(function () {
  $(window).attr("location","/");
});

Or if you prefer traditional JS:

Code:
document.getElementsByTagName('header').addEventListener('click',goHome,false);

function goHome() {
    window.location.href="/";
}

Basically I'm adding an event listener for an onClick for your header tag and redirects to "/" which is your home page (docroot, relative path). This is a cheap fix as there is an obvious dependency on JS/jQuery.

Add either into the theme's script.js where appropriate.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.