admin管理员组文章数量:1130349
I'm looking to add a link to buddypress profiles on author pages - the page that displays all posts by an individual author. The link would need to direct to the individuals buddypress profile, so need to call for author meta and replace the normal author link with bp_core_get_user_domain to grab the buddypress profile.
I have a description box at the top of the author page, with links to their social media accounts (see below) and would like to add this new link in line with that.
Any help would be appreciated.
<p class="desc"><?php echo esc_html( $curauth->description ); ?></p>
<p class="follow">
<?php
if ( get_the_author_meta('user_url', $curauth->ID) ) echo '<a class="home" href="'. esc_url(get_the_author_meta('user_url', $curauth->ID)) .'"><i class="fa fa-home"></i></a>';
if ( get_the_author_meta('facebook', $curauth->ID) ) echo '<a class="facebook" href="'. esc_url(get_the_author_meta('facebook', $curauth->ID)) .'"><i class="fa fa-facebook"></i></a>';
if ( get_the_author_meta('twitter', $curauth->ID) ) echo '<a class="twitter" href="'. esc_url(get_the_author_meta('twitter', $curauth->ID)) .'"><i class="fa fa-twitter"></i></a>';
if ( get_the_author_meta('gplus', $curauth->ID) ) echo '<a class="google-plus" href="'. esc_url(get_the_author_meta('gplus', $curauth->ID)) .'"><i class="fa fa-google-plus"></i></a>';
if ( get_the_author_meta('linkedin', $curauth->ID) ) echo '<a class="linkedin" href="'. esc_url(get_the_author_meta('linkedin', $curauth->ID)) .'"><i class="fa fa-linkedin"></i></a>';
?>
</p>
</div>
<!-- end:author-box -->
I'm looking to add a link to buddypress profiles on author pages - the page that displays all posts by an individual author. The link would need to direct to the individuals buddypress profile, so need to call for author meta and replace the normal author link with bp_core_get_user_domain to grab the buddypress profile.
I have a description box at the top of the author page, with links to their social media accounts (see below) and would like to add this new link in line with that.
Any help would be appreciated.
<p class="desc"><?php echo esc_html( $curauth->description ); ?></p>
<p class="follow">
<?php
if ( get_the_author_meta('user_url', $curauth->ID) ) echo '<a class="home" href="'. esc_url(get_the_author_meta('user_url', $curauth->ID)) .'"><i class="fa fa-home"></i></a>';
if ( get_the_author_meta('facebook', $curauth->ID) ) echo '<a class="facebook" href="'. esc_url(get_the_author_meta('facebook', $curauth->ID)) .'"><i class="fa fa-facebook"></i></a>';
if ( get_the_author_meta('twitter', $curauth->ID) ) echo '<a class="twitter" href="'. esc_url(get_the_author_meta('twitter', $curauth->ID)) .'"><i class="fa fa-twitter"></i></a>';
if ( get_the_author_meta('gplus', $curauth->ID) ) echo '<a class="google-plus" href="'. esc_url(get_the_author_meta('gplus', $curauth->ID)) .'"><i class="fa fa-google-plus"></i></a>';
if ( get_the_author_meta('linkedin', $curauth->ID) ) echo '<a class="linkedin" href="'. esc_url(get_the_author_meta('linkedin', $curauth->ID)) .'"><i class="fa fa-linkedin"></i></a>';
?>
</p>
</div>
<!-- end:author-box -->
Share
Improve this question
asked Dec 14, 2018 at 20:59
HaaznaHaazna
335 bronze badges
1 Answer
Reset to default 0Did you try using bp_core_get_user_domain() ?
For example:
echo '<a class="linkedin" href="'. bp_core_get_user_domain( $curauth->ID ) .'">Profile</a>'
I'm looking to add a link to buddypress profiles on author pages - the page that displays all posts by an individual author. The link would need to direct to the individuals buddypress profile, so need to call for author meta and replace the normal author link with bp_core_get_user_domain to grab the buddypress profile.
I have a description box at the top of the author page, with links to their social media accounts (see below) and would like to add this new link in line with that.
Any help would be appreciated.
<p class="desc"><?php echo esc_html( $curauth->description ); ?></p>
<p class="follow">
<?php
if ( get_the_author_meta('user_url', $curauth->ID) ) echo '<a class="home" href="'. esc_url(get_the_author_meta('user_url', $curauth->ID)) .'"><i class="fa fa-home"></i></a>';
if ( get_the_author_meta('facebook', $curauth->ID) ) echo '<a class="facebook" href="'. esc_url(get_the_author_meta('facebook', $curauth->ID)) .'"><i class="fa fa-facebook"></i></a>';
if ( get_the_author_meta('twitter', $curauth->ID) ) echo '<a class="twitter" href="'. esc_url(get_the_author_meta('twitter', $curauth->ID)) .'"><i class="fa fa-twitter"></i></a>';
if ( get_the_author_meta('gplus', $curauth->ID) ) echo '<a class="google-plus" href="'. esc_url(get_the_author_meta('gplus', $curauth->ID)) .'"><i class="fa fa-google-plus"></i></a>';
if ( get_the_author_meta('linkedin', $curauth->ID) ) echo '<a class="linkedin" href="'. esc_url(get_the_author_meta('linkedin', $curauth->ID)) .'"><i class="fa fa-linkedin"></i></a>';
?>
</p>
</div>
<!-- end:author-box -->
I'm looking to add a link to buddypress profiles on author pages - the page that displays all posts by an individual author. The link would need to direct to the individuals buddypress profile, so need to call for author meta and replace the normal author link with bp_core_get_user_domain to grab the buddypress profile.
I have a description box at the top of the author page, with links to their social media accounts (see below) and would like to add this new link in line with that.
Any help would be appreciated.
<p class="desc"><?php echo esc_html( $curauth->description ); ?></p>
<p class="follow">
<?php
if ( get_the_author_meta('user_url', $curauth->ID) ) echo '<a class="home" href="'. esc_url(get_the_author_meta('user_url', $curauth->ID)) .'"><i class="fa fa-home"></i></a>';
if ( get_the_author_meta('facebook', $curauth->ID) ) echo '<a class="facebook" href="'. esc_url(get_the_author_meta('facebook', $curauth->ID)) .'"><i class="fa fa-facebook"></i></a>';
if ( get_the_author_meta('twitter', $curauth->ID) ) echo '<a class="twitter" href="'. esc_url(get_the_author_meta('twitter', $curauth->ID)) .'"><i class="fa fa-twitter"></i></a>';
if ( get_the_author_meta('gplus', $curauth->ID) ) echo '<a class="google-plus" href="'. esc_url(get_the_author_meta('gplus', $curauth->ID)) .'"><i class="fa fa-google-plus"></i></a>';
if ( get_the_author_meta('linkedin', $curauth->ID) ) echo '<a class="linkedin" href="'. esc_url(get_the_author_meta('linkedin', $curauth->ID)) .'"><i class="fa fa-linkedin"></i></a>';
?>
</p>
</div>
<!-- end:author-box -->
Share
Improve this question
asked Dec 14, 2018 at 20:59
HaaznaHaazna
335 bronze badges
1 Answer
Reset to default 0Did you try using bp_core_get_user_domain() ?
For example:
echo '<a class="linkedin" href="'. bp_core_get_user_domain( $curauth->ID ) .'">Profile</a>'
本文标签: Buddypress profile link on author blogroll page
版权声明:本文标题:Buddypress profile link on author blogroll page 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749096577a2315349.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论