feed_links_extra [ WordPress Function ]
feed_links_extra ( $args = array() )
| Parameters: |
|
| Defined at: |
|
Soorgelijke functies: feed_links, get_feed_link, the_feed_link, get_links_withrating, get_links_list
Display the links to the extra feeds such as category feeds.
Source
<?php
function feed_links_extra( $args = array() ) {
$defaults = array(
/* translators: Separator between blog name and feed type in feed links */
'separator' => _x('»', 'feed link'),
/* translators: 1: blog name, 2: separator(raquo), 3: post title */
'singletitle' => __('%1$s %2$s %3$s Comments Feed'),
/* translators: 1: blog name, 2: separator(raquo), 3: category name */
'cattitle' => __('%1$s %2$s %3$s Category Feed'),
/* translators: 1: blog name, 2: separator(raquo), 3: tag name */
'tagtitle' => __('%1$s %2$s %3$s Tag Feed'),
/* translators: 1: blog name, 2: separator(raquo), 3: author name */
'authortitle' => __('%1$s %2$s Posts by %3$s Feed'),
/* translators: 1: blog name, 2: separator(raquo), 3: search phrase */
'searchtitle' => __('%1$s %2$s Search Results for “%3$s” Feed'),
);
$args = wp_parse_args( $args, $defaults );
if ( is_single() || is_page() ) {
$id = 0;
$post = &get_post( $id );
if ( comments_open() || pings_open() || $post->comment_count > 0 ) {
$title = sprintf( $args['singletitle'], get_bloginfo('name'), $args['separator'], esc_html( get_the_title() ) );
$href = get_post_comments_feed_link( $post->ID );
}
} elseif ( is_category() ) {
$term = get_queried_object();
$title = sprintf( $args['cattitle'], get_bloginfo('name'), $args['separator'], $term->name );
$href = get_category_feed_link( $term->term_id );
} elseif ( is_tag() ) {
$term = get_queried_object();
$title = sprintf( $args['tagtitle'], get_bloginfo('name'), $args['separator'], $term->name );
$href = get_tag_feed_link( $term->term_id );
} elseif ( is_author() ) {
$author_id = intval( get_query_var('author') );
$title = sprintf( $args['authortitle'], get_bloginfo('name'), $args['separator'], get_the_author_meta( 'display_name', $author_id ) );
$href = get_author_feed_link( $author_id );
} elseif ( is_search() ) {
$title = sprintf( $args['searchtitle'], get_bloginfo('name'), $args['separator'], get_search_query( false ) );
$href = get_search_feed_link();
}
if ( isset($title) && isset($href) )
echo '<link rel="alternate" type="' . feed_content_type() . '" title="' . esc_attr( $title ) . '" href="' . esc_url( $href ) . '" />' . "\n";
}
?>
Examples [ wp-snippets.com ]
Top Google zoekresultaten
- Cleanup WordPress Header - WP Engineer
Jul 13, 2009 ... remove_action( 'wp_head', 'feed_links_extra', 3 ); // Display the links to the extra feeds such as category feeds remove_action( 'wp_head', ...
wpengineer.com - WordPress › Support » Remove feed from wp_head
<?php remove_action( 'wp_head', 'feed_links_extra'); // Display the links to the extra feeds such as category feeds remove_action( 'wp_head', 'feed_links'); ...
wordpress.org - PHPXRef 0.7 : WordPress : Function Reference: feed_links_extra()
Function and Method Cross Reference. feed_links_extra(). Defined at: /wp- includes/general-template.php -> line 1615. No references found.
phpxref.ftwr.co.uk - feed_links_extra() WordPress function reference, arguments and ...
Display the links to the extra feeds such as category feeds.
queryposts.com