
如何在WordPress文章和页面上显示最近更新日期
the_feed_link ( $anchor, $feed = '' )
the_feed_link – 这个函数用来输出一个指向特定文章或页面的RSS提要的链接。它通常用在WordPress主题的头部部分。
显示feed类型的固定链接。
function the_feed_link( $anchor, $feed = '' ) { $link = '<a href="' . esc_url( get_feed_link( $feed ) ) . '">' . $anchor . '</a>'; /** * Filters the feed link anchor tag. * * @since 3.0.0 * * @param string $link The complete anchor tag for a feed link. * @param string $feed The feed type. Possible values include 'rss2', 'atom', * or an empty string for the default feed type. */ echo apply_filters( 'the_feed_link', $link, $feed ); }