WordPress分页显示相同的内容

时间:2016-06-22 11:38:41

标签: php html wordpress

我的wordpress分页存在问题。即使我点击了第2页,内容仍然是相同的。我正在使用额外的主题,我不知道我应该在哪里编辑/修改将对分页内容进行更改的代码。请帮助。

到目前为止,我认为wp的代码与我的问题相关

<?php $type = strtolower( et_get_option( 'archive_list_style', 'standard' ) ); ?>
<div class="posts-blog-feed-module <?php echo esc_attr( $type ); ?> post-module et_pb_extra_module module">
    <div class="paginated_page" <?php echo 'masonry' == $type ? 'data-columns' : ''; ?>>
    <?php
    if ( have_posts() ) :
        while ( have_posts() ) : the_post();
            $post_format = et_get_post_format();
            $post_format_class = !empty( $post_format ) ? 'et-format-' . $post_format : '';
            ?>
                <article id="post-<?php the_ID(); ?>" <?php post_class( 'hentry ' . $post_format_class ); ?>>
                    <div class="header">
                        <?php
                        $thumb_args = array(
                            'size'      => 'extra-image-medium',
                            'img_after' => '<span class="et_pb_extra_overlay"></span>',
                        );
                        require locate_template( 'post-top-content.php' );
                        ?>
                    </div>
                    <?php
                    if ( !in_array( $post_format, array( 'quote', 'link' ) ) ) {
                    ?>
                    <div class="post-content">
                        <?php $color = extra_get_post_category_color(); ?>
                        <h2 class="post-title"><a class="et-accent-color" style="color:<?php echo esc_attr( $color ); ?>;" href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
                        <div class="post-meta">
                            <p><?php echo extra_display_archive_post_meta(); ?></p>
                        </div>
                        <div class="excerpt">
                            <p><?php
                            if ( has_excerpt() ) {
                                the_excerpt();
                            } else {
                                $excerpt_length = get_post_thumbnail_id() ? '100' : '230';
                                et_truncate_post( $excerpt_length );
                            }
                            ?></p>
                            <a class="read-more-button" href="<?php the_permalink(); ?>"><?php echo esc_html__( 'Read More', 'extra' ); ?></a>
                        </div>
                    </div>
                    <?php } ?>
                </article>
            <?php
        endwhile;
    else :
        ?>
        <article class='nopost'>
            <h5><?php esc_html_e( 'Sorry, No Posts Found', 'extra' ); ?></h5>
        </article>
        <?php
    endif;
    ?>
    </div><!-- .paginated_page -->

    <?php global $wp_query; ?>
    <?php if ( $wp_query->max_num_pages > 1 ) { ?>
    <div class="archive-pagination">
        <?php echo extra_archive_pagination(); ?>
    </div>
    <?php } ?>
</div><!-- /.posts-blog-feed-module -->

0 个答案:

没有答案