Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Header configuration & styling (http://forum.bytesforall.com/forumdisplay.php?f=15)
-   -   Clickable banner link, searched without success (http://forum.bytesforall.com/showthread.php?t=7797)

cjfelton Jun 27, 2010 01:05 AM

Clickable banner link, searched without success
 
Thanks for this great theme! I am getting close to having my site done, and am stumped on one thing, how to make my banner link to an external web site. I've searched the forum, and thought I had the answer at http://forum.bytesforall.com/showthread.php?t=1926.

I have not been able to make this work. It causes an error that makes the site inaccessible until I upload the version I saved of the file. I am using Atahualpa version 3.4.9 and WP 2.9, and I have made the header image clickable. Is there updated code, or another place in the file to edit, since the post I reference above indicates it works up through 3.4.4?

Velma Jun 27, 2010 11:23 AM

Can you post your before and after code? At first glance that should still be working.

Velma

cjfelton Jun 27, 2010 05:53 PM

The section of code that the information in the post referenced is below. I've highlighted the line that was suggested as the change to make the banner link to an external site:


// Header Image
if ( strpos($header_items,'%image') !== FALSE ) {

ob_start();

$bfa_header_images = bfa_rotating_header_images();

echo '<div id="imagecontainer" class="header-image-container" style="background: url(' .
$bfa_header_images[array_rand($bfa_header_images)] . ') ' . $bfa_ata['headerimage_alignment'] . ' no-repeat;">';

if ($bfa_ata['header_image_clickable'] == "Yes") {
echo '<div class="clickable"><a class="divclick" title="';
bloginfo('name'); echo '" href ="'; bloginfo('url'); echo '/">&nbsp;</a></div>';

}

if ( $bfa_ata['header_opacity_left'] != 0 AND $bfa_ata['header_opacity_left'] != '' ) {
echo '<div class="opacityleft">&nbsp;</div>';
}

if ( $bfa_ata['header_opacity_right'] != 0 AND $bfa_ata['header_opacity_right'] != '' ) {
echo '<div class="opacityright">&nbsp;</div>';
}
// END: If Header Opacity

if ( $bfa_ata['overlay_blog_title'] == "Yes" OR $bfa_ata['overlay_blog_tagline'] == "Yes" ) {
echo '<div class="titleoverlay">';
if ($bfa_ata['overlay_blog_title'] == "Yes") {
echo '<h' . $bfa_ata['h_blogtitle'] . ' class="blogtitle"><a href="'; bloginfo('url'); echo '/">';
bloginfo('name'); echo '</a></h' . $bfa_ata['h_blogtitle'] . '>';
}
if ($bfa_ata['overlay_blog_tagline'] == "Yes") {
echo '<p class="tagline">'; bloginfo('description'); echo '</p>';
}
echo '</div>';
}

echo '</div>';

$header_image = ob_get_contents();

ob_end_clean();
}


I would really appreciate any help you or others can provide. Right now it links back to my home page, and I want to send a click to the Pepsi Refresh site.

Thanks!

lmilesw Jun 27, 2010 10:13 PM

Another way to accomplish this would be to put a new widget area in the header and use a widget with a hyperlinked banner immage.

Velma Jun 28, 2010 12:08 AM

I think Larry's suggestion would be easier.

and...

Code:

if ($bfa_ata['header_image_clickable'] == "Yes") {
echo '<div class="clickable"><a class="divclick" title="';
bloginfo('name'); echo '" href ="'http://then'/">&nbsp;</a></div>';

If we go by the instructions in the referenced post, I think it would change to this:

Code:

if ($bfa_ata['header_image_clickable'] == "Yes") {
echo '<div class="clickable"><a class="divclick" title="';
bloginfo('name'); echo '" href ="'http://thenewurl.com'/">&nbsp;</a></div>';

Is that what you tried?

Anyway...I still think Larry's suggestion would probably be the easiest to achieve what it is you'd like, without editing the actual theme code.

The disadvantage to editing the theme code is that when you update, you'll need to complete the same edits again on the new version.

With using the widget area, that would transfer over with any updates you do.

(Brilliant thinking, Larry. :) )

Warmly,

Velma

juggledad Jun 28, 2010 04:23 AM

in version 3.4.9-3.5.1 change line 301 from
HTML Code:

                bloginfo('name'); echo '" href ="'; bloginfo('url'); echo '/">&nbsp;</a></div>';
to
HTML Code:

                bloginfo('name'); echo '" href ="http://yourdomain.com" /">&nbsp;</a></div>';

cjfelton Jun 28, 2010 05:04 PM

Thanks all, I decided to go with JD's suggestion because I was familiar with this section of the file and I have a rapidly approaching deadline. Worked like a charm, a one minute fix, and I had even acquired the knowledge in the last couple of days to add the code to open the link in a new window. This forum has been incredibly helpful, and a donation is on the way to you JD as soon as my site is done tomorrow.

hartsook Oct 8, 2010 03:28 AM

I decided to use the suggestion to add a custom header widget area to add a link to the logo image in order to avoid having to reapply code patches each version upgrade. But positioning the image is tricky.

Iit sure would be nice if the theme were to support separate external href links for the logo and header images :)


All times are GMT -6. The time now is 09:53 AM.

Powered by vBulletin® Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.