【发布时间】:2019-01-10 22:16:30
【问题描述】:
【问题讨论】:
-
您可以按照 codex 创建自己的提要模板:codex.wordpress.org/Customizing_Feeds
【问题讨论】:
要从链接中删除 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 );
如需更多帮助,请参阅此链接:Click here。
您可以从核心wordpress文件夹/wp-includes/feed-rss2.php获取自定义提要模板的内容
希望对你有帮助。
【讨论】:
看看下面的代码sn-p:
global $post;
?>
<?php if ($post->ID == $pageid): ?>
<script type="text/javascript">
$("a").each(function() {
if ($(this).attr("rel")) {
$(this).removeAttr("rel");
}
});
</script>
<?php endif; ?>
【讨论】: