gpt4 book ai didi

plugins - 插件链接的 Nofollow 链接

转载 作者:塔克拉玛干 更新时间:2023-11-03 02:31:03 25 4
gpt4 key购买 nike

http://www.onlineincomestartup.com/drive-traffic-to-your-website/ ,在每个帖子中显示的作者简介中, nofollow image

我需要建立除 Google plus 之外的所有链接,出于 SEO 目的,我不关注。我正在使用一个名为 WP 的插件,关于作者。我想我需要对以下代码进行更改。但我不是那么好在编辑代码中。有人请帮助。谢谢

// Generate social icons
function wp_about_author_get_social_links($wp_about_author_settings){
$content="";
$socials = wp_about_author_get_socials();
foreach($socials as $social_key=>$social){
if (get_the_author_meta($social_key)){
if(isset($wp_about_author_settings['wp_author_social_images']) && $wp_about_author_settings['wp_author_social_images']){
$content .= "<a class='wpa-social-icons' rel="nofollow" href='".str_replace('%%username%%', get_the_author_meta($social_key), $social['link'])."'><img src='". $social['icon']."' alt='".$social['title']."'/></a>";
} else {
if($content != "")
$content .= apply_filters( 'wp_about_author_separator', " - ");
$content .= "<a href='".str_replace('%%username%%', get_the_author_meta($social_key), $social['link'])."'>".$social['title']."</a>";
}
}
}
return $content;
}

function wp_about_author_get_socials() {
$socials = array();
$socials['twitter'] = array('title'=>'Twitter', 'link'=>'http://www.twitter.com/%%username%%', 'icon'=> WPAUTHORURL_URL .'/images/twitter.png');
$socials['facebook'] = array('title'=>'Facebook', 'link'=>'http://www.facebook.com/%%username%%', 'icon'=> WPAUTHORURL_URL .'/images/facebook.png');
$socials['linkedin'] = array('title'=>'LinkedIn', 'link'=>'http://www.linkedin.com/in/%%username%%', 'icon'=> WPAUTHORURL_URL .'/images/linkedin.png');
$socials['pinterest'] = array('title'=>'Pinterest', 'link'=>'http://www.pinterest.com/%%username%%', 'icon'=> WPAUTHORURL_URL .'/images/pinterest.png');
$socials['googleplus'] = array('title'=>'Google Plus', 'link'=>'https://plus.google.com/%%username%%', 'icon'=> WPAUTHORURL_URL .'/images/googleplus.png');
$socials['digg'] = array('title'=>'Digg', 'link'=>'http://www.digg.com/%%username%%', 'icon'=> WPAUTHORURL_URL .'/images/digg.png');
$socials['flickr'] = array('title'=>'Flickr', 'link'=>'http://www.flickr.com/people/%%username%%', 'icon'=> WPAUTHORURL_URL .'/images/flickr.png');
$socials['stumbleupon'] = array('title'=>'StumbleUpon', 'link'=>'http://www.stumbleupon.com/stumbler/%%username%%', 'icon'=> WPAUTHORURL_URL .'/images/stumbleupon.png');
$socials['youtube'] = array('title'=>'YouTube', 'link'=>'http://www.youtube.com/user/%%username%%', 'icon'=> WPAUTHORURL_URL .'/images/youtube.png');
$socials['yelp'] = array('title'=>'Yelp', 'link'=>'http://www.yelp.com/user_details?userid=%%username%%', 'icon'=> WPAUTHORURL_URL .'/images/yelp.png');
$socials['reddit'] = array('title'=>'Reddit', 'link'=>'http://www.reddit.com/user/%%username%%', 'icon'=> WPAUTHORURL_URL .'/images/reddit.png');
$socials['delicious'] = array('title'=>'Delicious', 'link'=>'http://www.delicious.com/%%username%%', 'icon'=> WPAUTHORURL_URL .'/images/delicious.png');
return apply_filters( 'wp_about_author_get_socials', $socials );
}

最佳答案

您可以更改生成用户名链接的这一行

$content .= "<a href='".str_replace('%%username%%', get_the_author_meta($social_key), $social['link'])."'>".$social['title']."</a>";

$content .= "<a rel='nofollow' href='".str_replace('%%username%%', get_the_author_meta($social_key), $social['link'])."'>".$social['title']."</a>";

这应该会在您的链接中添加 nofollow。

关于plugins - 插件链接的 Nofollow 链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21720787/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com