Pagination can not link to page 2 wordpress?

Hi all I have problame with pagination with link to page 2 I installed plugin Wp-pagnavi ,When I click link to page 2 its dont show the content page 2,it still stay at page 1, How can I fix this.

you can see it at
http://westecmedia.com/?page_id=758

Read More

and this is my code blog post page:

<?php
/*
 *  Template Name: Page - Events Page
 */
?>

<?php get_header(); ?>

<div id="content-events">
    <div id="head-event"><h3>EVENTS</h3></div>
    <div id="main-event">

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

        <?php the_content(); ?>

    <?php endwhile; else: endif; ?>

    <?php query_posts('category_name='.get_the_title().'&post_status=publish,future');?>

    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <div id="part-event">
    <div id="entry-thumbnail">
            <?php the_post_thumbnail(); ?>

    </div>
    <div id="event-dess">
    <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
        <p>
            <?php 
            $content = get_the_content();
            $content = strip_tags($content);
            echo substr($content, 0, 300);
            ?>
        </p>
        <div id="read-more"><a href="<?php the_permalink(); ?>">Read More</a></div>
    </div>

</div>
        <div id="line-bottom"></div>
    <?php endwhile; else: endif; ?>
        <?php wp_pagenavi(); ?>

    </div>
</div>

<?php get_footer(); ?>

Help me please ?

Related posts

2 comments

  1. You should put all this in a loop and set wp_reset_query(); and also have to use paged option post per page in query_post .
    Try this

    <?php
    /*
     *  Template Name: Page - Events Page
     */
    ?>
    
    <?php get_header(); ?>
    <div id="content-events">
        <div id="head-event"><h3>EVENTS</h3></div>
        <div id="main-event">
    
                    <?php 
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts('posts_per_page=3&paged=' . $paged,category_name='.get_the_title().'&post_status=publish,future');?>
    
                    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
                        <div id="part-event">
                                <div id="entry-thumbnail">
                                        <?php the_post_thumbnail(); ?>
    
                                </div>
                                <div id="event-dess">
                                <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
                                    <p>
                                        <?php 
                                        $content = get_the_content();
                                        $content = strip_tags($content);
                                        echo substr($content, 0, 300);
                                        ?>
                                    </p>
                                    <div id="read-more"><a href="<?php the_permalink(); ?>">Read More</a></div>
                                </div>
    
                        </div>
                        <div id="line-bottom"></div>
                    <?php endwhile; endif; ?>
                        <?php wp_pagenavi(); ?>
    
                        <?php wp_reset_query(); ?>
    
    
        </div>
    </div>
    <?php get_footer(); ?>
    
  2. <?php
    $args = array(
        'cat' => '5',
        'post_type' => 'post',
        'posts_per_page' => 6,
        'paged' => ( get_query_var('paged') ? get_query_var('paged') : 1),
    );
    query_posts($args);
    while (have_posts()) : the_post();
     /* Do whatever you want to do for every page... */
    endwhile;
    wp_pagenavi();
    wp_reset_query();  // Restore global post data
    ?>
    

Comments are closed.