Answer the question
In order to leave comments, you need to log in
Wordpress pagination. Sees pages, but does not want to open - 404?
Hi all. I've blown my brains out already. On a normal /rent page, I output a cycle with posts through WP_Query. Knowingly passing there paged defined with
<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; ?>
<?php if ($query->max_num_pages > 1) : ?>
<div class="content-panel-body pagination">
<?php if ($paged > 1) : ?>
<a class="prev page-numbers" href="/rent/page/<?php echo $paged - 1; ?>"><i class="fa fa-angle-left"></i>Назад</a>
<?php endif; ?>
<span class="page-numbers current"><?php echo $paged, ' из ', $query->max_num_pages; ?></span>
<?php if ($paged != $query->max_num_pages) : ?>
<a class="next page-numbers" href="/rent/page/<?php echo $paged + 1; ?>">Вперёд<i class="fa fa-angle-right"></i></a>
<?php endif; ?>
</div>
<?php endif; ?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question