New answers tagged

0

Finally I found a solution for it. I set has_archive to true. Now both the feed and the archive page of CPT are active. To only disable the archive page of CPT, I use the following filter in the functions.php file: function AryanThemes_disable_cpt_archive_template(){ if ( is_post_type_archive('cpt') ) { global $wp_query; ...


1

Set the feeds argument of rewrite to true to generate feed rewrite rules. It defaults to whatever has_archive is set to if nothing is explicitly passed. $args = array( 'has_archive' => false, 'rewrite' => array( 'feeds' => true ), // your other args... );


1

Use WordPress functionality The function get_lastpostmodified() is extensively documented. It says in the wordpress documentation that the function accepts a timezone and a post_type. Documentation From WordPress Trac: wp-includes/post.php1 5355 * @param string $post_type Optional. The post type to check. Default 'any'. 5356 * @return string The ...


0

I was going to use the above answer from Otto but the more I looked at the templates the more it dawned on me that you don't need all that. Just hook the_author filter and check is_feed if you want a RSS specific author. function f_the_author( $display_name ) { // $display_name === string $authordata->display_name if ( is_feed() ) { ...


0

Based on the add_feed function, here's a prototype implementation of remove_feed: /** * Remove a feed type like /atom1/. * * @global WP_Rewrite $wp_rewrite * * @param string $feedname Feed name. * @return string Feed action name. */ function remove_feed( $feedname ) { global $wp_rewrite; if ( in_array( $feedname, ...



Top 50 recent answers are included