Quantcast
Channel: How to use has_archive but disable feed per post type? - WordPress Development Stack Exchange
Viewing all articles
Browse latest Browse all 4

Answer by Robert Went for How to use has_archive but disable feed per post type?

$
0
0

I just got this working in a theme by checking if we're on the archive page for an array of custom post types and then removing the feed link actions:

function themename_remove_feed_links() {    if ( is_post_type_archive( array( 'gallery', 'client', 'testimonial', 'slideshow' ) ) ) {        remove_action('wp_head', 'feed_links_extra', 3 );        remove_action('wp_head', 'feed_links', 2 );    }}add_action( 'template_redirect', 'themename_remove_feed_links' );

Viewing all articles
Browse latest Browse all 4

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>