wordpress页脚修改_如何在WordPress中控制RSS Feed页脚

wordpress页脚修改

Do you want to customize the RSS feed footer in WordPress? This allows you to add custom text, links, or even advertisements below your post content in the RSS feed. In this article, we will show you how to easily control your RSS feed footer in WordPress, and how to add custom feed only content to your posts.

您是否要在WordPress中自定义RSS feed页脚? 这使您可以在RSS提要中的帖子内容下方添加自定义文本,链接甚至广告。 在本文中,我们将向您展示如何轻松地在WordPress中控制RSS feed页脚,以及如何向帖子中添加仅自定义feed的内容。

Control RSS feed footer in WordPress
为什么要在WordPress的RSS Feed页脚中添加内容? (Why Add Content to RSS Feed Footer in WordPress?)

RSS feeds offer an easier way for users to read your blog posts in their favorite feed reader apps such as Feedly.

RSS feed为用户提供了一种更轻松的方式,使用户可以在其喜欢的feed阅读器应用程序(例如Feedly)中阅读您的博客文章。

However, RSS feeds can also be used by content scrapers to automatically steal your blog posts as soon as they are published. Sometimes these content scrapers end up ranking higher than your original post in search engines. To learn more, see our guide on how to prevent blog content scraping in WordPress.

但是,内容刮板还可以使用RSS feed在发布博客后自动窃取您的博客文章。 有时,这些内容抓取工具的排名最终会高于您在搜索引擎中的原始帖子。 要了解更多信息,请参阅有关如何防止在WordPress中抓取博客内容的指南。

Adding additional content to your RSS feed footer allows you to add backlinks to your main site and the original post at the end of each article. This allows you to rank higher for your posts even if they are copied by content scrapers.

在RSS feed页脚中添加其他内容,可以使您向主站点添加反向链接,并在每篇文章的末尾添加原始帖子。 即使您的帖子被内容抓取工具复制,这也可以使您的帖子排名更高。

By manipulating your RSS feed footer, you can also encourage readers to visit your website from time to time.

通过操纵RSS feed页脚,您还可以鼓励读者不时访问您的网站。

Having said that, let’s take a look at how to easily control your RSS feed footer in WordPress.

话虽如此,让我们看一下如何在WordPress中轻松控制RSS feed页脚。

方法1.使用Yoast SEO将内容添加到RSS Feed页脚 (Method 1. Add Content to RSS Feed Footer Using Yoast SEO)

This method is easier and recommended for all users. It uses the Yoast SEO plugin, which is the most popular WordPress SEO plugin.

此方法更简单,建议所有用户使用。 它使用Yoast SEO插件,这是最流行的WordPress SEO插件。

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

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

Upon activation, you need to visit SEO » Dashboard page and click on the ‘Features’ tab. Next, scroll down to the ‘Advanced settings pages’ section and make sure this option is ‘Enabled’.

激活后,您需要访问SEO»仪表板页面,然后单击“功能”选项卡。 接下来,向下滚动到“高级设置页面”部分,并确保此选项为“启用”。

Enable advanced settings pages in Yoast SEO

Don’t forget to save your changes to reload the plugin. After that, you will be able to see more options under the SEO menu.

不要忘记保存您的更改以重新加载插件。 之后,您将可以在SEO菜单下看到更多选项。

Next, you need to visit SEO » Advanced page and click on the RSS tab.

接下来,您需要访问SEO»高级页面,然后单击RSS选项卡。

Add content you want to show in RSS feed footer

Under the RSS feed settings, the first box allows you to add content before each post. The second box allows you to add content to the post footer.

在RSS feed设置下,第一个框允许您在每个帖子之前添加内容。 第二个框使您可以向后页脚添加内容。

Yoast SEO automatically adds credit text with backlink to your website in the RSS feed footer. You can either use the text as-is, or you can add your own content.

Yoast SEO会在RSS feed页脚中将带有反向链接的信用文本自动添加到您的网站。 您可以按原样使用文本,也可以添加自己的内容。

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

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

You can now view your RSS feed to see the changes. At the end of each article, you will be able to see content you added to your RSS feed footer.

现在,您可以查看RSS feed来查看更改。 在每篇文章的结尾,您将能够看到添加到RSS feed页脚中的内容。

Footer text in WordPress RSS feed
方法2:在WordPress中手动将内容添加到RSS feed页脚 (Method 2: Manually Add Content to RSS Feed Footer in WordPress)

This method requires you to add code to your WordPress files. If you haven’t done this before, then check out our guide on how to copy and paste code in WordPress.

此方法要求您将代码添加到WordPress文件中。 如果您以前没有做过,请查看有关如何在WordPress中复制和粘贴代码的指南。

You’ll need to copy and paste the following code in your theme’s functions.php file or a site-specific plugin.

您需要将以下代码复制并粘贴到主题的functions.php文件或特定站点的插件中


function wpb_feed_filter($query) {
if ($query->is_feed) {
add_filter('the_content','wpb_feed_content_filter');
add_filter('the_excerpt_rss','wpb_feed_content_filter');
}
return $query;
}
add_filter('pre_get_posts','wpb_feed_filter');
 
function wpb_feed_content_filter($content) {
// Content you want to show goes here 
$content .= '<p>Thanks for reading, check out <a href="'. get_bloginfo('url') .'">'. get_bloginfo('name') .'</a> for more awesome stuff.</p>';
return $content;
}

This code simply checks if the page requested is an RSS feed, and then filters the content to display your message in the RSS feed footer.

此代码仅检查请求的页面是否为RSS feed,然后过滤内容以在RSS feed页脚中显示您的消息。

We hope this article helped you learn how to control RSS feed footer in WordPress. You may also want to see these helpful tips to optimize your WordPress RSS feed and get more traffic.

我们希望本文能帮助您学习如何在WordPress中控制RSS feed页脚。 您可能还希望查看这些有用的提示,以优化WordPress RSS feed并获得更多流量。

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/plugins/control-your-rss-feeds-footer-in-wordpress/

wordpress页脚修改

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值