@Rango_31

Не работает пагинация на главной (статической) странице wordpress. Как исправить?

Всем доброго дня. Не работает пагинация на странице когда выбираю в настройках ее главной (статической), на других страницах работает обычно.
d046c16436944f88ae6a2c664e602a4a.png
Возможно это лечится где то здесь, но так как в php не силен, ладу не дам.
function imax_paging_nav() {
	
	global $wp_query;
	


	// Don't print empty markup if there's only one page.
	if ( $wp_query->max_num_pages < 2 )
		return;
	?>
    <?php
		$big = 999999999; // need an unlikely integer
		$args = array(
			'base' => str_replace( $big, '%#%', get_pagenum_link( $big ) ),
			'format' => '?paged=%#%',
			'current' => max( 1, get_query_var('paged') ),
			'total' => $wp_query->max_num_pages,
			'type' => 'list',
			'prev_text' => '<span class="text">&laquo; ' . __( 'Previous', 'i-max' ) . '</span>',
			'next_text' => '<span class="text">' . __( 'Next', 'i-max' ) . ' &raquo;</span>',
			'add_args' => false					
		);
		
	?>		

	
	<nav class="navigation paging-navigation" role="navigation">
		<h1 class="screen-reader-text"><?php _e( 'Posts navigation', 'i-max' ); ?></h1>
		<div class="nav-links">
            <div id="posts-nav" class="navigation">
				<?php echo paginate_links( $args ); ?>
            </div><!-- #posts-nav -->
		</div><!-- .nav-links -->
	</nav><!-- .navigation -->
	<?php
}
endif;

if ( ! function_exists( 'imax_post_nav' ) ) :
/**
 * Display navigation to next/previous post when applicable.
*
* @since i-max 1.0
*
* @return void
*/
function imax_post_nav() {
	global $post;

	// Don't print empty markup if there's nowhere to navigate.
	$previous = ( is_attachment() ) ? get_post( $post->post_parent ) : get_adjacent_post( false, '', true );
	$next     = get_adjacent_post( false, '', false );

	if ( ! $next && ! $previous )
		return;
	?>
	<nav class="navigation post-navigation" role="navigation">
		<h1 class="screen-reader-text"><?php _e( 'Post navigation', 'i-max' ); ?></h1>
		<div class="nav-links">

			<?php previous_post_link( '%link', _x( '<span class="meta-nav">&larr;</span> %title', 'Previous post link', 'i-max' ) ); ?>
			<?php next_post_link( '%link', _x( '%title <span class="meta-nav">&rarr;</span>', 'Next post link', 'i-max' ) ); ?>

		</div><!-- .nav-links -->
	</nav><!-- .navigation -->
	<?php
}
endif;
  • Вопрос задан
  • 1344 просмотра
Пригласить эксперта
Ответы на вопрос 1
@Andy-shak
Попробуй обновить ссылки или построить по другому запрос.
Что на подобие
<?php query_posts( array('cat'=>2, 'paged'=>get_query_var('paged'), 'posts_per_page'=>'5' ) ); ?>
			<?php //query_posts('cat=2&posts_per_page=2'); ?>
		 <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php endwhile; ?>
<?php posts_nav_link(' • ','&#171;Prev','Next&#187;'); ?>
<?php else: ?>
<?php endif; wp_reset_query(); ?>
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы