• Resolved jdoez

    (@jdoez)


    I have added the code to let my blogs go to a second page, but when it goes to the second page, it only shows that there are no posts found even though there should still be a couple more blogs on that page. Here is my code:

    <?php get_header(); ?>
    
    <div class="header-bar">
        <h1><?php single_post_title(); ?></h1>
    </div>
    
    <div id="page-wrapper">
        <div id="page" class="container">
            <div id="main-wrapper">
                <div id="main" class="clearfix  with-navigation">
                    <div id="content" class="column span12">
                        <div class="section">
                            <div id="content-area">
    
                                    <div class="panel-display zen-one-sidebar-second clearfix">
    
                                        <div class="panel-content">
    
                                            <?php query_posts
                                            ("posts_per_page=10&paged="
                                                .get_query_var('paged')); ?>
    
                                            <?php if (have_posts() ) : while (have_posts()) : the_post(); ?>
    
                                            <h2 class="blog-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
                                            <?php if ( has_post_thumbnail() ) {
                                            the_post_thumbnail(); }
                                            ?>
                                            <p><?php echo get_the_excerpt(); ?> </p>
                                            </br>
                                            <p class = "date pull-left">
                                                Posted on <span> <?php the_time
                                                ('F j, Y'); ?></span> </p>
                                            <p class="pull-right">
                                                Posted under <?php the_category( ', ' ); ?> by <?php the_author(); ?>
                                            </p> </br> </br>
                                            <hr>
    
                                            <?php endwhile; ?>
    
                                                <?php else : ?>
                                                <p><?php _e('Sorry, no posts
                                                matched your criteria.'); ?></p>
                                            <?php endif; ?>
    
        <div class="navigation"><p><?php posts_nav_link(); ?></p></div>
    
                                            <div>Feed: <a href="<?php bloginfo('atom_url'); ?>">Atom</a> | <a href="<?php bloginfo('rss2_url'); ?>">RSS</a></div>
                                        </div>
    
                                        <div class="panel-sidebar-first"><?php get_sidebar( 'blog' ); ?></div>
    
                                    </div><!--/content class -->
    
                            </div><!-- /content-area -->
                        </div>
                    </div><!-- /.section, /#content -->
                </div>
            </div><!-- /#main, /#main-wrapper -->
        </div><!-- /#page -->
    </div><!-- /#page-wrapper -->
    
    <?php get_footer(); ?>

    It shows up a link that says, “Next Page ?”, but when you click on the link, even though it takes you to https://myurl.com/blog/page/2, it has no blog posts.

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Blogs not showing on page 2 and up’ is closed to new replies.