WordPress.org

Ready to get started?Download WordPress

Forums

pagination does not work with query_posts. Help! (3 posts)

  1. berez
    Member
    Posted 1 year ago #

    I made ​​a separate page template (added sidebar), this page contains all the posts. Pagination works!
    But, if this page set as the home page, pagination is not working!
    Please help find solutions myself I can not ...

    This my code

    <?php
    /*
    Template Name: Шаблон страницы с сайдбаром
    */
    
    ?>
    
     <?php get_header () ; ?>
    
     <div id="container" class="cf">
    <h1 class="cat-title"> <?php single_cat_title(); ?> </h1>
    <?php query_posts( array('showposts' => 0, 'paged' => get_query_var('paged') ) ); ?>
    	 <?php if (have_posts()) : while (have_posts()) : the_post();?>
    
     <div class="post post-left">
    
    <div class="post-image">
    <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail(); ?></a>
    </div>
    		   <h1 class="entry-title"><a href="<?php the_permalink() ?>" rel="bookmark" title="К посту <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h1>
    
              		  <div class="entry-content">
              <?php the_content(); ?>
    
    		  <div class="entry-readmore"><a href="<?php the_permalink(); ?>" class="more-link">Читать полностью</a></div>
    		  </div>
           <div class="entry-meta">
    	<div class="meta-inner">
            <span class="date">
                <strong class="day"><?php the_time('d') ?></strong>
                <div class="holder">
                    <div class="month"><?php the_time('M') ?></div>
                    <div class="year"><?php the_time('Y') ?></div>
                </div>
            </span>
            <span class="author">
                <strong class="title">АВТОР</strong><br />
                <?php the_author_posts_link() ?>        </span>
            <span class="cat">
                <strong class="title">РУБРИКА</strong><br />
            <?php the_category(); ?>      </span>
            <span class="Tags">
                <strong class="title">МЕТКИ</strong><br />
               <?php the_tags(''); ?></span>
                        <span class="comments">
                    <strong class="title">КОММЕНТАРИИ</strong><br>
                    <?php comments_popup_link( 'Комментариев нет', '1 комментарий', '% штука', 'comments-link', 'Админ закрыл напрочь комментирование'); ?>         </span>
                </div>
    
    </div>
    </div>
    <?php get_sidebar('Sidebar'); ?>
    		 <?php endwhile; ?>
    
    		 <div class='pagination'>
    		 <?php my_pagination(); ?>
    		 </div>
    
             <?php endif; ?>
    <?php wp_reset_query(); ?>
    
    	 </div>
    	 <?php get_footer () ; ?>
  2. Keyur
    Member
    Posted 1 year ago #

    Hello, I am using kgPager.class for Pagination in my site. It was working in 3.4 wordpress version, once i have upgrade my version to 3.5.1 it is not working . anyone please help me out ?

    After searching word, while clicking on 2 page, its not working.

  3. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    @Keyur

    please start your own topic

Topic Closed

This topic has been closed to new replies.

About this Topic