Last active
July 24, 2018 09:35
-
-
Save patrickposner/bb83d3537c96080ef05fa9a14520f3c8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| function atomion_get_posts_pagination( Array $args = array() ) { | |
| global $wp_query; | |
| $paginated = $wp_query->max_num_pages; | |
| if ( $paginated < 2 ) | |
| return ''; | |
| $default_args = array( | |
| 'base' => str_replace( 999999999, '%#%', get_pagenum_link( 999999999 ) ), | |
| 'current' => max( 1, get_query_var( 'paged' ) ), | |
| 'format' => '', | |
| 'mid_size' => 2, | |
| 'total' => $wp_query->max_num_pages, | |
| 'type' => 'list', | |
| 'prev_text' => sprintf( | |
| '<span title="%s">‹</span>', | |
| __( 'Previous', 'muenchen' ) | |
| ), | |
| 'next_text' => sprintf( | |
| '<span title="%s">›</span>', | |
| __( 'Next', 'muenchen' ) | |
| ), | |
| ); | |
| $args = wp_parse_args( $args, $default_args ); | |
| $output = paginate_links( $args ); | |
| echo $output; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment