Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Atahualpa 3 Wordpress theme (http://forum.bytesforall.com/forumdisplay.php?f=2)
-   -   [SOLVED] Set a link in Blog tagline? (http://forum.bytesforall.com/showthread.php?t=1195)

baskenburg Apr 9, 2009 02:05 PM

[SOLVED] Set a link in Blog tagline?
 
Hi,

Is is possible to create a link in the blog tagline? For instance, making "New England Birdhouse" link to an external site in the tagline "Observations about the business of New England Birdhouse." I tried <a href> unsuccessfully.

thanks

Flynn Apr 10, 2009 02:22 PM

To do this for all places where the tagline is used on your blog (including places that may not be visible), filter the bloginfo function (which contains the tagline) by adding the following to the bottom of functions.php - without causing any blank lines or spaces in functions.php:

PHP Code:

<?php        
function blog_filter($string$show) {
    if ( 
$show == "description" ) {
        
$string str_replace('New England Birdhouse''<a href="http://www.yoursite.com/">New England Birdhouse</a>'$string);
    }
return 
$string;
}
add_filter('bloginfo''blog_filter'10);
?>

This would be a problem if for instance a SEO/Meta Tag plugin uses the tagline and puts it into the <HEAD>...</HEAD> section as a meta tag. If you use the solution above, click through your site afterwards, view the source code and make sure you don't have something like

<meta name="meta name here" content="Welcome to <a href="...">blog description</a>" />

in the <HEAD> .... </HEAD> section of any page of your site, because that may confuse search engines.


The other way to do this, perhaps better for what you want to do, would be to edit functions/bfa_header_config.php

Change

PHP Code:

ob_start(); bloginfo('description'); $logo_area .= '<p class="tagline">' ob_get_contents() . 
'</p>'ob_end_clean(); 

to

PHP Code:

$logo_area .= '<p class="tagline">Your tagline with <a href="link">a link</a> here</p>'


baskenburg Apr 10, 2009 11:28 PM

Thanks!

Your second alternative works like a charm.

Very much appreciated.:)

Azzaspec May 4, 2009 04:07 PM

I'm trying to do something similar. Why can't I find the edit functions/bfa_header_config.php. Can you help me locate it??

Thanks!

ScottKarlins Nov 26, 2009 10:23 AM

Quote:

Originally Posted by Flynn (Post 4698)
To do this for all places where the tagline is used on your blog (including places that may not be visible), filter the bloginfo function (which contains the tagline) by adding the following to the bottom of functions.php - without causing any blank lines or spaces in functions.php:

PHP Code:

<?php        
function blog_filter($string$show) {
    if ( 
$show == "description" ) {
        
$string str_replace('New England Birdhouse''<a href="http://www.yoursite.com/">New England Birdhouse</a>'$string);
    }
return 
$string;
}
add_filter('bloginfo''blog_filter'10);
?>

This would be a problem if for instance a SEO/Meta Tag plugin uses the tagline and puts it into the <HEAD>...</HEAD> section as a meta tag. If you use the solution above, click through your site afterwards, view the source code and make sure you don't have something like

<meta name="meta name here" content="Welcome to <a href="...">blog description</a>" />

in the <HEAD> .... </HEAD> section of any page of your site, because that may confuse search engines.


The other way to do this, perhaps better for what you want to do, would be to edit functions/bfa_header_config.php

Change

PHP Code:

ob_start(); bloginfo('description'); $logo_area .= '<p class="tagline">' ob_get_contents() . 
'</p>'ob_end_clean(); 

to

PHP Code:

$logo_area .= '<p class="tagline">Your tagline with <a href="link">a link</a> here</p>'



Flynn,

Trying to do method #2 in your text above, but in my bfa_header_config.php file, I cannot find the code to change. I am using version 3.4.2

Thank you!
Scott K.

juggledad Nov 26, 2009 08:16 PM

in version 3.4.2-3.4.4 change line 168 of bfa_header_config.php from
HTML Code:

$logo_area .= '<p class="tagline">' . $bfa_ata['bloginfo_description'] . '</p>';
to
HTML Code:

$logo_area*.=*'<p*class="tagline">Your*tagline*with*<a*href="link">a*link</a>*here</p>';

ScottKarlins Nov 27, 2009 08:41 AM

Thanks for the reply Juggledad!

One additional question... How do I do just text, but make my Tagline multiline? I want to do some text, then on the next line some more text, so that it all is not on one long line.

Thank you!
Scott K.

juggledad Nov 27, 2009 08:48 AM

try adding a '<br>' where you want the line break

ScottKarlins Nov 27, 2009 09:17 AM

Ok, I am putting my Title and Tagline overlaying on my header, not above it.

I see this further down the bfa_header_config.php:

if ( $bfa_ata['overlay_blog_title'] == "Yes" OR $bfa_ata['overlay_blog_tagline'] == "Yes" ) {
$header_image .= '<div class="titleoverlay">' .
( $bfa_ata['overlay_blog_title'] == "Yes" ? '<h' . $bfa_ata['h_blogtitle'] . ' class="blogtitle"><a href="' . $bfa_ata['get_option_home'] . '/">' .
$bfa_ata['bloginfo_name'] . '</a></h' . $bfa_ata['h_blogtitle'] . '>' : '' ) . ( $bfa_ata['overlay_blog_tagline'] == "Yes" ? '<p class="tagline">' .
$bfa_ata['bloginfo_description'] . '</p>' : '' ) . '</div>';

So, I assume I make my changes here? I tried inserting what you had in your post, and I get errors. Does something different need to go here?

Thank you,
Scott K.

juggledad Nov 27, 2009 09:54 AM

if you are using the overlay, then you want to change line 296 (ver 3.4.2 - 3.4.4) from
HTML Code:

                        $bfa_ata['bloginfo_description'] . '</p>' : '' ) . '</div>';
to
HTML Code:

                        'Your tagline <br>with <a href="link">a link</a> here</p>' : '' ) . '</div>';

ScottKarlins Nov 27, 2009 10:24 AM

Juggledad,

Thank you! That did the trick. Much appreciated!

Scott K.


All times are GMT -6. The time now is 12:04 PM.

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