Update (not show!) a feed after publish a custom post type
-
Hi,
surfing in the web I found this useful snippet to show custom post types in the feed and in the homepage. But unfortunately when I publish a new custom post type it doesn’t update the feed and it update it only after I publish a normal post, and then I can see both the post both the custom post type I previously published.
So what have I to edit in this script??add_filter( 'pre_get_posts', 'my_get_posts' ); function my_get_posts( $query ) { if ( ( is_home() && false == $query->query_vars['suppress_filters'] ) || is_feed() ) $query->set( 'post_type', array( 'post', 'custom_post') ); return $query; }
Thanks all!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Update (not show!) a feed after publish a custom post type’ is closed to new replies.