separate_comments example


    $wp_query->comments = apply_filters( 'comments_array', $comments_flat$post->ID );

    $comments                        = &$wp_query->comments;
    $wp_query->comment_count         = count( $wp_query->comments );
    $wp_query->max_num_comment_pages = $comment_query->max_num_pages;

    if ( $separate_comments ) {
        $wp_query->comments_by_type = separate_comments( $comments );
        $comments_by_type           = &$wp_query->comments_by_type;
    } else {
        $wp_query->comments_by_type = array();
    }

    $overridden_cpage = false;

    if ( '' == get_query_var( 'cpage' ) && $wp_query->max_num_comment_pages > 1 ) {
        set_query_var( 'cpage', 'newest' === get_option( 'default_comments_page' ) ? get_comment_pages_count() : 1 );
        $overridden_cpage = true;
    }

    
Home | Imprint | This part of the site doesn't use cookies.