Fix indentation & space usage
This commit is contained in:
parent
024ddea2ab
commit
ee459e936b
|
@ -13,9 +13,13 @@ if ( ! function_exists ( 'understrap_pagination' ) ) {
|
|||
|
||||
function understrap_pagination( $args = array(), $class = 'pagination' ) {
|
||||
|
||||
if ($GLOBALS['wp_query']->max_num_pages <= 1) return;
|
||||
if ( $GLOBALS['wp_query']->max_num_pages <= 1 ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$args = wp_parse_args( $args, array(
|
||||
$args = wp_parse_args(
|
||||
$args,
|
||||
array(
|
||||
'mid_size' => 2,
|
||||
'prev_next' => true,
|
||||
'prev_text' => __( '«', 'understrap' ),
|
||||
|
@ -23,7 +27,8 @@ if ( ! function_exists ( 'understrap_pagination' ) ) {
|
|||
'screen_reader_text' => __( 'Posts navigation', 'understrap' ),
|
||||
'type' => 'array',
|
||||
'current' => max( 1, get_query_var( 'paged' ) ),
|
||||
) );
|
||||
)
|
||||
);
|
||||
|
||||
$links = paginate_links( $args );
|
||||
|
||||
|
@ -34,16 +39,14 @@ if ( ! function_exists ( 'understrap_pagination' ) ) {
|
|||
<ul class="pagination">
|
||||
|
||||
<?php
|
||||
|
||||
foreach ( $links as $key => $link ) { ?>
|
||||
|
||||
<li class="page-item <?php echo strpos( $link, 'current' ) ? 'active' : '' ?>">
|
||||
|
||||
foreach ( $links as $key => $link ) {
|
||||
?>
|
||||
<li class="page-item <?php echo strpos( $link, 'current' ) ? 'active' : ''; ?>">
|
||||
<?php echo str_replace( 'page-numbers', 'page-link', $link ); ?>
|
||||
|
||||
</li>
|
||||
|
||||
<?php } ?>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</ul>
|
||||
|
||||
|
|
Reference in New Issue