前端页面分享twitter_如何在个人资料页面上显示作者的Twitter和Facebook

前端页面分享twitter

Do you want to display your author’s Twitter and Facebook links on their WordPress profile page? By default, WordPress user profile page does not have any fields to add Facebook or Twitter profiles. In this article, we will show you how to easily display author’s Twitter and Facebook profile links in WordPress.

您是否要在其WordPress个人资料页面上显示作者的Twitter和Facebook链接? 默认情况下,WordPress用户个人资料页面没有任何可添加Facebook或Twitter个人资料的字段。 在本文中,我们将向您展示如何轻松地在WordPress中显示作者的Twitter和Facebook个人资料链接。

How to Add Author's Twitter & Facebook in WordPress Profile Page
影片教学 (Video Tutorial)

演示地址

If you don’t like the video or need more instructions, then continue reading.

如果您不喜欢该视频或需要更多说明,请继续阅读。

1.使用Author Bio Box添加Twitter和Facebook个人资料 (1. Add Twitter and Facebook Profiles with Author Bio Box)

This method is easier and is recommended for all users.

此方法更简单,建议所有用户使用。

First, you need to install and activate the Author Bio Box plugin. For more details, see our step by step guide on how to install a WordPress plugin.

首先,您需要安装并激活Author Bio Box插件 。 有关更多详细信息,请参阅有关如何安装WordPress插件的分步指南。

Upon activation, you need to visit the Settings » Author Bio Box page in your WordPress admin to configure plugin settings.

激活后,您需要访问WordPress管理员中的“设置”»“作者生物文件夹”页面以配置插件设置。

Author bio box

First you need to select where you want to display the author bio box. The plugin can automatically show the author bio box below posts only or below posts and on homepage.

首先,您需要选择要显示作者简介框的位置。 该插件可以自动在仅帖子下方或帖子下方以及主页上显示作者简介框。

After that you can select background color, text color, gravatar size, border, etc.

之后,您可以选择背景颜色,文本颜色,图像大小,边框等。

Don’t forget to click on the save changes button to store your settings.

不要忘记单击“保存更改”按钮来存储您的设置。

Next, you need to go to the Users » All Users page. Here you need to click on the edit link below the user account.

接下来,您需要转到用户»所有用户页面。 在这里,您需要单击用户帐户下方的编辑链接。

Edit author profile

This will bring you to the user’s profile page. You will notice that there are new social profile fields available on this page.

这将带您进入用户的个人资料页面。 您会注意到此页面上有新的社交资料字段。

Now you just need to enter the author’s Facebook, Twitter, or any other social media profile URLs in the respective fields.

现在,您只需要在相应字段中输入作者的Facebook,Twitter或任何其他社交媒体个人资料URL。

Enter your social profile URLs

Once you are done, click on the update profile link.

完成后,单击更新配置文件链接。

You can now view any posts written by that user, and you will see their author bio box with icons for their Twitter, Facebook, and other social media profiles.

现在,您可以查看由该用户撰写的任何帖子,并且您将看到其作者的生物方框,其中带有其Twitter,Facebook和其他社交媒体个人资料的图标。

Author bio box with social profiles

Registered users on your WordPress site can also edit their own profiles to add links for their Facebook and Twitter pages. You can also send an email to all registered users on your website and ask them to update their profiles.

WordPress网站上的注册用户还可以编辑自己的配置文件,以为其Facebook和Twitter页面添加链接。 您还可以网站上的所有注册用户发送电子邮件,并要求他们更新其个人资料。

2.使用Yoast SEO显示Twitter和Facebook个人资料 (2. Display Twitter and Facebook Profiles with Yoast SEO)

This method is for advanced users because it will require you to edit WordPress theme files. If you haven’t done this before, then check out our guide on how to copy and paste code in WordPress.

此方法适用于高级用户,因为它将要求您编辑WordPress主题文件。 如果您以前没有做过,请查看有关如何在WordPress中复制和粘贴代码的指南。

If you are already using Yoast SEO plugin on your website, then you are in luck as it can be used to add Twitter and Facebook profile fields in author’s profile page.

如果您已经在网站上使用Yoast SEO插件,那么您很幸运,因为它可用于在作者的个人资料页面中添加Twitter和Facebook个人资料字段。

The problem is that Yoast does not automatically display them in the author bio, but don’t worry we will show you how to do that.

问题在于,Yoast不会自动在作者简介中显示它们,但是请放心,我们将向您展示如何做到这一点。

Related: How to properly install and setup Yoast SEO plugin on your website.

相关: 如何在您的网站上正确安装和设置Yoast SEO插件

Once you have Yoast plugin setup, you need to head over to the Users » All Users page, and then click on the edit link below the author name.

安装Yoast插件后,您需要转到“ 用户»所有用户”页面,然后单击作者名称下方的编辑链接。

Edit author profile

On the user’s profile page, you will notice new Facebook and Twitter profile fields. For Twitter, you just need to enter the user handle without @ symbol.

在用户的个人资料页面上,您会注意到新的Facebook和Twitter个人资料字段。 对于Twitter,您只需要输入不带@符号的用户句柄。

For Facebook, you will need to enter the complete Facebook profile URL.

对于Facebook,您需要输入完整的Facebook个人资料URL。

Facebook and Twitter fields in user profile

Once you are done, click on the update profile button to store your changes.

完成后,单击更新配置文件按钮以存储您的更改。

Now you need to display these fields as links in your theme.

现在,您需要将这些字段显示为主题中的链接。

You can do this by adding the following code to your theme files where you want to display the author profile links.

您可以通过在想要显示作者个人资料链接的主题文件中添加以下代码来做到这一点。


<?php 
$twitter = get_the_author_meta( 'twitter', $post->post_author );
$facebook = get_the_author_meta( 'facebook', $post->post_author );
echo '<a href="https://twitter.com/' . $twitter .'" rel="nofollow" target="_blank">Twitter</a> | <a href="'. $facebook .'" rel="nofollow" target="_blank">Facebook</a>';
?> 

Save your changes and view a post on your website.

保存您的更改并查看您网站上的帖子。

Here is how it looked on our demo website.

这是在我们的演示网站上的外观。

Author social profile links

We hope this article helped you learn how to display author’s Twitter and Facebook profile links in WordPress. You may also want to see our list of how to show an authors list with photos in WordPress.

我们希望本文能帮助您学习如何在WordPress中显示作者的Twitter和Facebook个人资料链接。 您可能还想查看我们的列表, 列表显示如何在WordPress中显示带有照片的作者列表

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

如果您喜欢这篇文章,请订阅我们的YouTube频道 WordPress视频教程。 您也可以在TwitterFacebook上找到我们。

翻译自: https://www.wpbeginner.com/wp-tutorials/how-to-display-authors-twitter-and-facebook-on-the-profile-page/

前端页面分享twitter

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
很抱歉,作为一个AI语言模型,我无法展示HTML页面。但是,我可以提供一个简单的HTML和CSS代码框架,你可以根据自己的需求和审美进行修改和美化。 ```html <!DOCTYPE html> <html> <head> <title>Beautiful Frontend Page</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link href="https://fonts.googleapis.com/css?family=Montserrat:400,700&display=swap" rel="stylesheet"> <link rel="stylesheet" type="text/css" href="style.css"> </head> <body> <header> <nav> <div class="logo"><a href="#">Your Logo</a></div> <div class="menu"> <ul> <li><a href="#">Home</a></li> <li><a href="#">Features</a></li> <li><a href="#">Pricing</a></li> <li><a href="#">Contact</a></li> </ul> </div> </nav> <div class="hero"> <h1>Your Headline</h1> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed neque velit, lobortis ut magna a, tristique accumsan enim. Praesent auctor molestie orci ac maximus. Fusce eleifend, risus eu sagittis fringilla, ipsum enim bibendum turpis, vitae convallis neque libero euismod ligula.</p> <button>Get Started</button> </div> </header> <section class="features"> <div class="container"> <div class="feature-box"> <div class="icon"><i class="fas fa-mobile-alt"></i></div> <h2>Responsive Design</h2> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed neque velit, lobortis ut magna a, tristique accumsan enim.</p> </div> <div class="feature-box"> <div class="icon"><i class="fas fa-cog"></i></div> <h2>Customizable</h2> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed neque velit, lobortis ut magna a, tristique accumsan enim.</p> </div> <div class="feature-box"> <div class="icon"><i class="fas fa-lock"></i></div> <h2>Secure</h2> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed neque velit, lobortis ut magna a, tristique accumsan enim.</p> </div> </div> </section> <section class="pricing"> <div class="container"> <h2>Our Pricing</h2> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed neque velit, lobortis ut magna a, tristique accumsan enim.</p> <div class="price-box"> <div class="price-plan"> <h3>Basic</h3> <h4>$19/month</h4> <ul> <li>Feature 1</li> <li>Feature 2</li> <li>Feature 3</li> </ul> <button>Choose Plan</button> </div> <div class="price-plan"> <h3>Pro</h3> <h4>$49/month</h4> <ul> <li>Feature 1</li> <li>Feature 2</li> <li>Feature 3</li> <li>Feature 4</li> </ul> <button>Choose Plan</button> </div> <div class="price-plan"> <h3>Premium</h3> <h4>$99/month</h4> <ul> <li>Feature 1</li> <li>Feature 2</li> <li>Feature 3</li> <li>Feature 4</li> <li>Feature 5</li> </ul> <button>Choose Plan</button> </div> </div> </div> </section> <footer> <div class="container"> <div class="footer-box"> <h3>About Us</h3> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed neque velit, lobortis ut magna a, tristique accumsan enim.</p> </div> <div class="footer-box"> <h3>Contact Us</h3> <ul> <li>123 Main St.</li> <li>Anytown, USA 12345</li> <li>email@example.com</li> <li>555-123-4567</li> </ul> </div> <div class="footer-box"> <h3>Follow Us</h3> <ul> <li><a href="#">Facebook</a></li> <li><a href="#">Twitter</a></li> <li><a href="#">Instagram</a></li> <li><a href="#">LinkedIn</a></li> </ul> </div> </div> </footer> </body> </html> ``` 该代码使用了HTML5、CSS3和FontAwesome图标库,包含了导航栏、主题头图、特色介绍、价格计划和页脚等模块。你可以在CSS文件中添加样式和颜色,美化页面
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值