-
-
Save mayeenulislam/2b7fd2d092bca527e521eb51079dfc72 to your computer and use it in GitHub Desktop.
Display a pagination for custom admin panel query mostly with WordPress styling.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$posts_per_page = get_option( 'posts_per_page ); | |
$paged = $_GET['paged'] ? $_GET['paged'] : 1; | |
$tutsnano_page_query = new WP_Query( | |
array( | |
'post_type' => 'page', | |
'post_status' => 'publish', | |
'posts_per_page' => $posts_per_page, | |
'paged' => $paged | |
) | |
); | |
while( $tutsnano_page_query->have_posts() ) : $tutsnano_page_query->the_post(); | |
//displaying the query data as per choice | |
endwhile; wp_reset_postdata(); | |
//display the pagination here | |
tutsnano_admin_query_pagination( $tutsnano_page_query, $posts_per_page, 'admin.php?page=my_page_slug' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$posts_per_page = get_option( 'posts_per_page ); | |
$paged = $_GET['paged'] ? $_GET['paged'] : 1; | |
$tutsnano_page_query = new WP_Query( | |
array( | |
'post_type' => 'page', | |
'post_status' => 'publish', | |
'posts_per_page' => $posts_per_page, | |
'paged' => $paged | |
) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment