14 posts
  • Exclusive Author
  • Has been a member for 1-2 years
ReikiStudios says

My pagination in my blog keeps repeating the first page of content on all pages. How can I fix this? Any help would be greatly appreciated.

Here is the code I have so far:

<?php
/*
Template Name: Blog
*/
get_header(); ?>
    <div id="content_wrap">
        <div id="content">
            <h1><?php the_title(); ?></h1>
            <img src="<?php bloginfo('template_directory');?>/images/content_line.png" border="0" alt="" />
            <div id="blog_wrap">
                <?php
        query_posts( array('post_type' => 'post') ); 
                if ( have_posts() ) :
                    while(have_posts()) : the_post();?>
                    <div class="blog_post">
                        <?php if ( has_post_thumbnail() ) : ?> 
                        <div class="blog_post_img">
                            <?php the_post_thumbnail('post-thumb'); ?>
                        </div>
                        <?php endif; ?>
                        <div class="blog_post_text" if="" :="">style="width: 640px;"<?php endif; ?>><h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3><?php the_excerpt(); ?></div>
                        <div class="clear" />
                        <div class="post_details">
                            <ul>
                                <li class="posted_by"><?php _e('Posted By','Static Strings');?> <?php the_author_posts_link(); ?></li>
                                <li class="date"><?php echo get_the_date('F jS, Y'); ?></li>
                                <li class="post_comment"><?php 
                                   $comments_count = wp_count_comments($post->ID); 
                                   $comment_count = $comments_count->approved;                                 
                                   if($comment_count != 0): ?>
                                        <a href="<?php the_permalink();?>"> 
                                            <?php echo $comment_count; ?> 
                                        </a>
                                        <?php    
                                        if($comment_count == 1): echo " Comment";
                                        elseif($comment_count > 1): echo " Comments";
                                        endif;
                                   else:
                                        echo " No Comments";
                                   endif;       
                                   ?>
                                </li>
                                <li class="read_more">
                                    <a href="<?php the_permalink();?>"><?php _e('Read more','Static Strings'); ?></a>
                                </li>
                            </ul>
                        </div>
                        <img src="<?php bloginfo('template_directory');?>/images/cont_line.png" border="0" alt="" />
                    </div> 
                <?php
                endwhile;
                else: ?>
                     <p><?php _e('In this category no posts.'); ?></p>
                <?php
                endif;

                ?> 
                <div class="navigation" style="margin-bottom:25px;"><?php posts_nav_link(); ?></div>  

            </div>
        </div>
        <?php get_sidebar(); ?>
        <?php wp_reset_query(); ?>  
        <div class="clear" />
    </div>
<?php get_footer(); ?>    

 
707 posts
  • Sold between 10 000 and 50 000 dollars
  • Referred between 10 and 49 users
  • Bought between 10 and 49 items
  • Has been a member for 5-6 years
  • Exclusive Author
  • Envato Studio (Microlancer) Beta Tester
ChillThemes says

Try changing this:

query_posts( array('post_type' => 'post') );

to

query_posts( array( 'post_type' => 'post', 'paged' => $paged ) );
217 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 3-4 years
  • Referred between 1 and 9 users
  • Sold between 1 000 and 5 000 dollars
  • United Kingdom
NuclearThemes says
Like itsmattadams said although you may also need to add
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
above it.
14 posts
  • Exclusive Author
  • Has been a member for 1-2 years
ReikiStudios says

Thanks a bunch I made the edits and it works perfectly! You guys are awesome!

by
by
by
by
by
by