How to fix pagination not found in wordpress?

I am a new of wordpress. I have a problem with pagination when I click to the next post it shows “not found”. I installed the plugin wp pagenavi, and I put code in my blog post . It shows the pagination, but I have a problem with the link to the next post. Example when I click to the next post it is show

Something went Wrong!
404
-->

You can see at: http://westecmedia.com/events/

Read More

And this is my code in event-page.php:

<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

1 comment

  1. Maybe you missed the object here. You can try the code below:

    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
      $args = array(
          'posts_per_page' => get_option('posts_per_page'),
          'paged' => $paged,
          'category_name'=>get_the_title(),
          'post_status'=> array('publish', 'future')
     ); 
     query_posts($args);
    

    instead:

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

Comments are closed.