the_feed_link

函式
the_feed_link ( $anchor, $feed = '' )
引數
  • (string) $anchor The link's anchor text.
    Required:
  • (string) $feed Optional. Feed type. Possible values include 'rss2', 'atom'. Default is the value of get_default_feed().
    Required:
    Default: (empty)
定義位置
相關方法
get_feed_linkfeed_linksget_tag_feed_linkget_author_feed_linkget_term_feed_link
引入
3.0.0
棄用
-

the_feed_link – 這個函式用來輸出一個指向特定文章或頁面的RSS提要的連結。它通常用在WordPress主題的頭部部分。

顯示feed型別的固定連結。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
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 );
}
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 ); }
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 );
}

常見問題

FAQs
檢視更多 >