Simplicityの新着記事ヴィジェットにカスタム投稿タイプを含める方法
functionに以下コピペ
●その1
まずこれでやってみて。
// 新着記事に指定のカスタム投稿タイプを含める function chample_latest_posts( $wp_query ) { if ( is_home() && ! isset( $wp_query->query_vars['suppress_filters'] ) ) { $wp_query->query_vars['post_type'] = array('post', 'column','blog', 'prtopics', 'beauty', 'eat', 'spot', 'fortune', 'psychology' ); } } add_action( 'parse_query', 'chample_latest_posts' );
●その2
その1がうまくいかなかったらこっちで。
// 新着記事に指定のカスタム投稿タイプを含める function custom_post_add_top( $query ) { if ( is_admin() || ! $query->is_main_query() ) return; if ( $query->is_home() ) { $query->set( 'post_type', array( 'post', 'column', 'blog', 'prtopics', 'beauty', 'eat', 'spot', 'fortune', 'psychology' ) ); return; } } add_action( 'pre_get_posts', 'custom_post_add_top' );
●