Pagination. Classes name mistake for item of pagination
-
Hi, I have created pagination for comments using the default method.
<?php $args = array( 'post_id' => get_the_ID(), 'parent' => 0, 'count' => true, ); $top_level_comments_count = get_comments($args); $max_pages = ceil($top_level_comments_count / $per_page); $args = array( 'screen_reader_text' => __('Comments navigation'), 'aria_label' => __('Comments'), 'class' => 'comments-pagination', 'format' => '', 'total' => $max_pages, 'current' => $page, 'prev_text' => '?', 'next_text' => '?', 'type' => 'list', 'echo' => false, // Установите это значение в false ); $pagination = get_the_comments_pagination($args); $pagination = str_replace('#comments', '', $pagination); ?> <div class="company-rewiew-pagination"> <?php echo $pagination; ?> </div>
This challenge created this pagination for me
<div class="company-rewiew-pagination"> <nav class="navigation comments-pagination" aria-label="Comments"> <h2 class="screen-reader-text">Comments navigation</h2> <div class="nav-links"> <ul class="page-numbers"> <li><span aria-current="page" class="page-numbers current">1</span></li> <li><a class="page-numbers" >2</a></li> <li><a class="page-numbers" >3</a></li> <li><a class="next page-numbers" >?</a></li> </ul> </div> </nav> </div>
But I got a bug into name of class wrapper. It has the same class like for
<li><a class="page-numbers">
item.class="page-numbers"
Can You fix this mistake ? Can you make for item<li><a class="page-number">
name?I also don’t understand, why if I choose
'type' => 'plain'
I will get different name of classes.<div class="company-rewiew-pagination"> <nav class="navigation comments-pagination" aria-label="Comments"> <h2 class="screen-reader-text">Comments navigation</h2> <div class="nav-links"><span aria-current="page" class="page-numbers current">1</span> <a class="page-numbers" >2</a> <a class="page-numbers" >3</a> <a class="next page-numbers" >?</a></div> </nav> </div>
with the same problem –
<code><a class="next page-numbers"</code>
should be<a class="next page-number"
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Pagination. Classes name mistake for item of pagination’ is closed to new replies.