wordpress - 如何从提要页面中删除 rel="nofollow"
解决方案
要从链接中删除 nofollow,请在您当前活动的主题functions.php文件中添加以下代码。
rss 挂钩不允许更改标签内的内容,因此请为您的提要创建自定义模板。
/**
* Deal with the custom RSS templates.
*/
function my_custom_rss() {
if ( 'photos' === get_query_var( 'post_type' ) ) {
get_template_part( 'feed', 'photos' );
} else {
get_template_part( 'feed', 'rss2' );
}
}
remove_all_actions( 'do_feed_rss2' );
add_action( 'do_feed_rss2', 'my_custom_rss', 10, 1 );
如需更多帮助,请参阅此链接:单击此处。
您可以从核心 wordpress 文件夹中获取自定义提要模板的内容/wp-includes/feed-rss2.php
我希望它会帮助你。
推荐阅读
- r - 尝试比较两个数据帧,并将逻辑结果写入 R 中的新数据帧
- php - AWS s3 使用 PHP 列出对象键
- c# - 输出导致项目名称而不是枚举类型?
- javascript - JavaScript:如何仅显示一个插入字符串的数组项?
- php - Wordpress - 如何在自定义 Visual Composer 元素中指定 ID
- html - 如何在 Angular 5 中动态选择下拉列表?
- mingw - msys2 (mingw) 默认库/包含路径配置
- azure - 无法访问 Azure Active Directory
- python - 如何调整matplotlib中每第二行子图之间的空间
- javascript - 如何跟踪菜单中的 CSS 类?