Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm a newb at Wordpress, but my HTML/CSS is ok. My site is: http://www.modernfuture.net/wordpress

been working on it this for quite some time & I'm done with the headaches, need to get some answers from the pros!

My Problem: When I click on "next" or "2" to get to the next pagination page. Instead of showing the remaining posts in the loop, what's displayed is "page not found"

My Speculation: I'm not sure at all, but my hunch is that it has something to do with the loop.php (as the permalinks settings, functions.php, and pagination.php have remained untouched) anyway here's the code:

<!--featured-->

<div id="featured"> 
<?php query_posts('posts_per_page=1&cat=4'); ?> 
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?> 


<!-- post featured thumbnail -->
<div id="featuredThumb"><div id="featuredTitle">
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a>
</div>
        <?php if ( has_post_thumbnail()) : // Check if thumbnail exists ?>
            <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
                <?php the_post_thumbnail(array(287,250), array('class' => 'featuredThumb')); // Declare pixel size you need inside the array ?>

            </a>

        <?php endif; ?>
     </div>   
        <!-- /post featured thumbnail --> 




<?php endwhile; ?> <?php wp_reset_query(); ?> 
</div>
<!--/featured-->

<?php 
$temp = $wp_query;
$wp_query= null;
$wp_query = new WP_Query();
$wp_query->query('showposts=6&cat=1'.'&paged='.$paged);
?>



<?php if ($wp_query -> have_posts()): while ($wp_query -> have_posts()) : $wp_query -> the_post(); ?>

        <?php $column = ($column == '') ? 'first' : (($column == 'first') ? 'middle' : (($column == 'middle') ? 'last' : 'first' )); ?>
    <!-- article -->
    <article  <?php post_class($column); ?> id="post-<?php the_ID(); ?>" <?php post_class(); ?>>

        <!-- post thumbnail -->
        <?php if ( has_post_thumbnail()) : // Check if thumbnail exists ?>
            <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
                <?php the_post_thumbnail(array(120,120),array('class' => 'loopThumb')); // Declare pixel size you need inside the array ?>

            </a>

        <?php endif; ?>
        <!-- /post thumbnail -->
        <!--<div class="thumbBorder"></div>-->

        <!-- post title -->
        <div class="titleWrapper"><h2>
            <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a>
        </h2></div> 
        <!-- /post title -->


    </article>

    <!-- /article -->

<?php endwhile; ?>

<?php else: ?>

    <!-- article -->
    <article>
        <h2><?php _e( 'Sorry, nothing to display.', 'html5blank' ); ?></h2>
    </article>
    <!-- /article -->

<?php endif; ?>

I have two loops going. One that makes the featured post appear, and the other makes the normal posts appear.

I'm not sure what's causing the problem but I hope this helps. Any help appreciated! Thanks in advance!

share|improve this question
1  
see this answer –  Milo Aug 29 '13 at 2:15
1  
It's strongly recommended to not use query_posts() -- see wordpress.stackexchange.com/questions/50761/… for details. –  Pat J Aug 29 '13 at 2:18
    
Hey thanks for your replies but this doesn't really help me :/ - could you please elaborate more? I'm very new to PHP. Thanks! –  asstaters Aug 29 '13 at 6:31
    
NVM y'all I fixed my problem on my own! For those of you interested in how I fixed it - it had nothing to do with needing to use pre_get_posts! All it boiled down to was that I needed to go into the wp-admin page (the wordpress dashboard) and go to Settings then Reading and in the "Blog pages show at most" field I changed the value from '10' to '6' (the number of posts I indicated in $wp_query->query('showposts=6&cat=1'.'&paged='.$paged);) What a simple solution! I can't believe I haven't found it on another thread! Cheers! –  asstaters Aug 29 '13 at 6:46

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.