Get pagination with $_POST
-
Hello,
I’ve got a page with a Form tht filters the posts. For ex il the user selects a author in the form, the page will load a specific query post.
Unfortunatly, when I click on age 2, the $_POST is not sent to the page,and so it returns the page 2 of all the posts from all authors…I don’t know if I’m clear.
if(isset($_POST['author'])){ $author= $_POST['author']; $args = array( 'post_type' => 'formationcontinue', 'posts_per_page' => 10, 'order' => 'DESC', 'author' => $author, 'paged' => get_query_var('paged') ); } else { $args = array( 'post_type' => 'formationcontinue', 'posts_per_page' => 10, 'order' => 'DESC', 'paged' => get_query_var('paged')} if( $the_query->have_posts() ){ // The Loop while ( have_posts() ) : the_post(); ?> <li> <a>"> <?php the_title(); ?></a> </li> <?php endwhile; wp_pagenavi( array( 'query' => $the_query ) ); // Reset Query wp_reset_postdata(); }
Do you know how I can make this work ?
Thx!!!!
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Get pagination with $_POST’ is closed to new replies.