• Good afternoon! Modify the template and stopped working pagination. How do I fix the error?

    <?php
    /*
    Template Name: stranyi
    */
    ?>
    
    <?php get_header(); ?>
    
    <?php $query = new WP_Query( array( 'cat' => 8, 'orderby' => 'title', 'order' => 'ASC' ) ); ?>
    <div class="content section-inner">
    
    <?php if (have_posts()) : ?>
    
    		<?php
    		$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    		$total_post_count = wp_count_posts();
    		$published_post_count = $total_post_count->publish;
    		$total_pages = ceil( $published_post_count / $posts_per_page );
    
    		if ( "1" < $paged ) : ?>
    
    <div class="page-title">
    
    				<h4><?php printf( __('Page %s of %s', 'hitchcock'), $paged, $wp_query->max_num_pages ); ?></h4>
    
    			</div> <!-- /page-title -->
    
    			<div class="clear"></div>
    
    		<?php endif; ?>	
    
    		<div class="posts" id="posts">
     <?php while ( $query->have_posts() ) : $query->the_post(); ?>
    
    	    		<?php get_template_part( 'content', get_post_format() ); ?>
    
    	        <?php endwhile; ?>
    
    	        <div class="clear"></div>
    
    		</div> <!-- /posts -->
    
    	<?php endif; ?>
    
    	<div class="clear"></div>
    
    	<?php hitchcock_archive_navigation(); ?>
    
    <?php wp_reset_query() ?>
    
    <br><br><p style="text-align: center;"><span style="color: #ffffff;"><strong>ПУТЕВОДИТЕЛЬ ПО СТРАНАМ:</strong></span></p><br>
    
    <?php $query = new WP_Query( array( 'cat' => 8, 'paged' => get_query_var('paged'), 'orderby' => 'title', 'order' => 'ASC', 'posts_per_page' => -1 ) ); ?>
     <?php while ( $query->have_posts() ) :
        $query->the_post();?>
    <a href="<?php the_permalink()?>" style="color:#fff">
    <?php the_title();?>,</a>
     <?php endwhile; ?>
    <?php wp_reset_query() ?>
    
    </div> <!-- /content -->
    <?php get_footer(); ?>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘not working pagination’ is closed to new replies.