Hide button after load last page
-
I have button which works almost great with this plugin but that button won’t hide after click on last page when it’s not necessary.
Test products are on 3 pages and the source code of my pagination button is:<?php $current_page = get_query_var('page'); if ( ! $current_page ) { $current_page = 1; } if($current_page < $wc_query->max_num_pages+1):?> <div class="btn-next-wrap col-xs-10 col-xs-offset-1 text-center"><a class="btn-next btn btn-transparent" href="<?php echo site_url()?>/shop/?page=<?php echo $current_page+1;?>">Load more products</a></div> <?php endif; ?>
When I use it as standard pagination it works properly with condition
if($current_page < $wc_query->max_num_pages) except if($current_page < $wc_query->max_num_pages+1). But in that case the button remains with link to the 3rd page and after click it shows products from that page several times infinitely.The page I need help with: [log in to see the link]
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Hide button after load last page’ is closed to new replies.