Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Post-Kicker, -Byline & -Footer (http://forum.bytesforall.com/forumdisplay.php?f=17)
-   -   Byline link opening in new window (http://forum.bytesforall.com/showthread.php?t=1544)

ronald73 May 5, 2009 03:21 AM

Byline link opening in new window
 
Hi all,

I have a website with lots of posts imported from other sites through rss. In the byline I have a link to the original author, using %author-link%. When you click the link it opens in the same window and so the visitor is gone. How do I make the link open in a new window?

Flynn May 5, 2009 07:29 PM

You#d have to edit bfa_postinfo.php for that

Replace
PHP Code:

// Author website link
if (strpos($postinfo_string,'%author-link%')!==FALSE) {
ob_start(); the_author_link(); $author_link ob_get_contents(); ob_end_clean();
$postinfo str_replace("%author-link%"$author_link$postinfo);


with
PHP Code:

// Author website link
if (strpos($postinfo_string,'%author-link%')!==FALSE) {
ob_start(); 
if (
get_the_author_url()) {
    echo 
'<a target="_new" href="' get_the_author_url() . 
    
'" title="' sprintf(__("Visit the website of %s"), get_the_author()) . 
    
'" rel="external">' get_the_author() . '</a>';
} else {
    
the_author();
}
$author_link ob_get_contents(); ob_end_clean();
$postinfo str_replace("%author-link%"$author_link$postinfo);



ronald73 May 6, 2009 01:55 AM

Thanks, but I'm using the latest version of atahualpa, but the code you suggest is nowhere to be found in bfa_postinfo.php.
Even the word 'website' isn't in the code, and I've also searched for 'if (strpos($postinfo_string,'%author-link%')!==FALSE)' but it's not there.
So for now, this doesn't work.

Update: it does work! I just found out there are 2 versions of bfa_postinfo.php

Thanks!


All times are GMT -6. The time now is 02:05 AM.

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