Worpdress + BBPress ответы на посты форума не отображаются - PullRequest
0 голосов
/ 25 июня 2019

Я создаю собственную тему WordPress, и одна из страниц предназначена для форума bbpress. Форум и темы отображаются правильно, но "ответить" тело темы не отображается.

Я прочитал это из-за pre_get_posts, мои текущие изменения следующие

add_filter('pre_get_posts', 'query_post_type');
function query_post_type($query) {
  if( is_category() ) {
    $post_type = get_query_var('post_type');
    if($post_type)
        $post_type = $post_type;
    else
        $post_type = array('nav_menu_item', 'post', 'faq', 'forum', 'page','topic', 'reply');
    $query->set('post_type',$post_type);
    return $query;
    }
}


add_filter( 'pre_get_posts', 'tgm_io_cpt_search' );

function tgm_io_cpt_search( $query ) {

    if ( $query->is_search ) {
    $query->set( 'post_type', array( 'post', 'faq', 'forum', 'page','topic', 'reply' ) );
    }

    return $query;

}



 function custom_type_archive_display($query) {
    if (is_post_type_archive('faq')) {
         $query->set('posts_per_page',-1);
         $query->set('orderby', 'title' );
         $query->set('order', 'ASC' );
        return;
    }     
}
add_action('pre_get_posts', 'custom_type_archive_display');

Нет ответов на пользовательскую тему, даже когда я добавляю в pre_get_posts

...