Near to make it work, but something is wrong,..
-
Hi there,
I’m near to make the plugin work, but something is wrong. In order for you to check the HTML structure, I have voluntary desactivated your plugin. Please take a look here : https://www.les-alternatives.com/
The context is this one : this is my home page, in which I want to display multiple pagination (each news by categories) : the first one is an overall news grid, the second one is my softwares news grid, the third one is my games news grid (not paginated yet). As you can see, the pagination is working properly, and individually, for each grid… by adding a query string in the url.
The problem is this one : if I activate your plugin, and setting the proper selectors, it will only display the “load more” link in my last grid… and moreover with the query string of my first grid (?overall).
I can’t figure out how to solve this, since the pagination is correctly wrapped (.custom-pagination is a child of my POSTS selector).
My settings are :
#OVERALL (“Les dernières news”)
POSTS : .container-news.overall-cpt
POST : .clickable-container.overall-cpt
NAVIGATION : .custom-pagination
NEXT : a.next#SOFTARES (“Les derniers logiciels publiés”)
POSTS : .container-news.logiciels
POST : .clickable-container.logiciels
NAVIGATION : .custom-pagination
NEXT : a.nextHere are my 2 queries (in case you need them) :
$unique_class_container = 'overall-cpt'; $my_cpt_filter = 'jeu,logiciel,post'; $my_terms_filter = 'fiche'; $paged = isset($_GET['overall']) ? (int) $_GET['overall'] : 1; $args = array( 'post_type' => explode(',', $my_cpt_filter), 'posts_per_page' => 3, 'paged' => $paged, 'post_status' => 'publish', 'orderby' => 'date', 'tax_query' => array( array( 'taxonomy' => 'custom_type', 'field' => 'slug', 'terms' => explode(',', $my_terms_filter), 'compare' => 'IN', ), ), ); // The Query $the_query = new WP_Query( $args ); // The Loop if ( $the_query->have_posts() ) { echo'<div class="container-news ',$unique_class_container,' animated zoomInUp delay-750ms duration-1000ms">'; while ( $the_query->have_posts() ) : $the_query->the_post(); if ( has_post_thumbnail()) { echo '<a class="clickable-container ' ,$unique_class_container,'" href="' ,the_permalink(), '" title="' ,the_title_attribute(), '"> <div class="single-news">' ,fly_get_attachment_image( get_post_thumbnail_id(), array( 410, 240 ), true ), ' <div class="overlay"> <div class="overlay-content">' ,the_excerpt(), '</div> </div> </div> <div class="clickable-container info-container"> <h3 class="responsive-title">' ,the_title(), '</h3> <div class="responsive-date"> Publié il y a ' ,human_time_diff( get_the_time('U'), current_time('timestamp') ), '</div> </div> </a>'; } endwhile; if ($the_query->max_num_pages > 1) : $paginateArgs = array( 'format' => '?overall=%#%', 'current' => $paged, // Reference the custom paged query we initially set. 'total' => $the_query->max_num_pages // Max pages from our custom query. ); echo '<div class="custom-pagination">',paginate_links( $paginateArgs ),'</div> </div>'; endif; } /* Restore original Post Data */ wp_reset_postdata(); }
$unique_class_container = 'logiciels'; $my_cpt_filter = 'logiciel'; $my_terms_filter = 'fiche'; $paged_logiciels = isset($_GET['logiciels']) ? (int) $_GET['logiciels'] : 1; $args = array( 'post_type' => explode(',', $my_cpt_filter), 'posts_per_page' => 1, 'paged' => $paged_logiciels, 'post_status' => 'publish', 'orderby' => 'date', 'tax_query' => array( array( 'taxonomy' => 'custom_type', 'field' => 'slug', 'terms' => explode(',', $my_terms_filter), 'compare' => 'IN', ), ), ); // The Query $the_query_logiciels = new WP_Query( $args ); // The Loop if ( $the_query_logiciels->have_posts() ) { echo'<div class="container-news ' ,$unique_class_container, ' animated zoomInUp delay-750ms duration-1000ms">'; while ( $the_query_logiciels->have_posts() ) : $the_query_logiciels->the_post(); if ( has_post_thumbnail()) { echo '<a class="clickable-container ' ,$unique_class_container,'" href="' ,the_permalink(), '" title="' ,the_title_attribute(), '"> <div class="single-news">' ,fly_get_attachment_image( get_post_thumbnail_id(), array( 410, 240 ), true ), ' <div class="overlay"> <div class="overlay-content">' ,the_excerpt(), '</div> </div> </div> <div class="clickable-container info-container"> <h3 class="responsive-title">' ,the_title(), '</h3> <div class="responsive-date"> Publié il y a ' ,human_time_diff( get_the_time('U'), current_time('timestamp') ), '</div> </div> </a>'; } endwhile; if ($the_query_logiciels->max_num_pages > 1) : $paginateArgs_logiciels = array( 'format' => '?logiciels=%#%', 'current' => $paged_logiciels, // Reference the custom paged query we initially set. 'total' => $the_query_logiciels->max_num_pages // Max pages from our custom query. ); echo '<div class="custom-pagination">',paginate_links( $paginateArgs_logiciels ),'</div> </div>'; endif; } /* Restore original Post Data */ wp_reset_postdata(); }
Your help will be really appreciated.
Kind regards.
- The topic ‘Near to make it work, but something is wrong,..’ is closed to new replies.