Created
March 12, 2013 07:07
-
-
Save furahaclothing/5140877 to your computer and use it in GitHub Desktop.
wordpress-カスタム投稿 rss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//RSSを独自出力 | |
function custom_post_rss_set( $query ) { | |
if ( is_feed() ) { | |
$post_type = $query->get( 'post_type' ); | |
if ( empty( $post_type ) ) { | |
$query->set( 'post_type', array( 'post', 'blog' ) ); | |
} | |
return $query; | |
} | |
} | |
add_filter( 'pre_get_posts', 'custom_post_rss_set' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment