Results Text
Providing users with pagination context in Ajax Load More queries
In this example:
Ajax Load More will display the total number of posts loaded and total number of posts available to the user.
By adding the following HTML element to a template or page, Ajax Load More will render pagination information for users that provides context on the amount of content available.
1 |
<div class="alm-results-text"></div> <!-- Renders: Viewing 4 of 18 results. --> |
-
-
Introducing the WooCommerce Add-on for Ajax Load More
Infinite scrolling WooCommerce shop and product archives.
The following shortcode was used to create the Results Text example.
[ajax_load_more preloaded="true" preloaded_amount="2" posts_per_page="2" scroll="false" pause="true" repeater="template_46" button_label="Load More" button_loading_label="Loading..." layouts="true" layouts_cols="2"]
The following Repeater Template was used to create the Results Text example.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
<li class="alm-layout alm-blog-card-2"> <?php if ( has_post_thumbnail() ) { ?> <div class="alm-gallery-img-wrap"> <?php the_post_thumbnail('alm-cta'); ?> </div> <?php }?> <div class="alm-card-details"> <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3> <?php alm_get_excerpt(20); ?> <p class="alm-more-link"><a href="<?php the_permalink(); ?>"><?php _e('Continue Reading'); ?></a></p> <?php echo get_avatar( get_the_author_meta('user_email')); ?> </div> <div class="alm-post-author"> <span class="author-name"> By: <?php the_author_posts_link(); ?> • <?php the_time("M d, Y"); ?> </span> </div> </li> |