WordPress.org

Ready to get started?Download WordPress

Forums

How to disable Comments Feed in WordPress 3 Twentyten (5 posts)

  1. romanczar
    Member
    Posted 4 years ago #

    Hi,
    I use The new Twentyten ("2010") as parent theme for my own child theme. 2010 has a line of code in its functions.php

    // Add default posts and comments RSS feed links to head
    add_theme_support( 'automatic-feed-links' );

    This calls a MASTER function of WP3 in the file general-tempalte.php

    function feed_links( $args = array() ) {
    	if ( !current_theme_supports('automatic-feed-links') )
    		return;
    
    	$defaults = array(
    		/* translators: Separator between blog name and feed type in feed links */
    		'separator'	=> _x('»', 'feed link'),
    		/* translators: 1: blog title, 2: separator (raquo) */
    		'feedtitle'	=> __('%1$s %2$s Feed'),
    		/* translators: %s: blog title, 2: separator (raquo) */
    		'comstitle'	=> __('%1$s %2$s Comments Feed'),
    	);
    
    	$args = wp_parse_args( $args, $defaults );
    
    	echo '<link rel="alternate" type="' . feed_content_type() . '" title="' . esc_attr(sprintf( $args['feedtitle'], get_bloginfo('name'), $args['separator'] )) . '" href="' . get_feed_link() . "\" />\n";
    	echo '<link rel="alternate" type="' . feed_content_type() . '" title="' . esc_attr(sprintf( $args['comstitle'], get_bloginfo('name'), $args['separator'] )) . '" href="' . get_feed_link( 'comments_' . get_default_feed() ) . "\" />\n";
    }

    Both feed AND feed comments are added, so can't even use any hook/action to disabled the comments seperately.

    Has anyone an idead of how to do that? I only want to offer the feeds, no comments as RSS.

    THANKS

  2. romanczar
    Member
    Posted 3 years ago #

    I am still looking for a solution to this... Anyone?

  3. Herbert
    Member
    Posted 3 years ago #

    Put:

    remove_theme_support( 'automatic-feed-links' );

    in child theme header.php, just above wp_head()

    And place the rss link using: bloginfo( 'stylesheet_url' );

    Worked for me ;)

  4. Herbert
    Member
    Posted 3 years ago #

    sorry blog_info ('stylesheet_url') should be blog_info ('rss_url')

  5. Herbert
    Member
    Posted 3 years ago #

    wow, must be sill sleeping here... I meant:

    bloginfo('rss_url');

    Could have used the comment edit for correcting my mistake, but still sleeping here.. hahaha :D

Topic Closed

This topic has been closed to new replies.

About this Topic