Skip to content

Commit 5143645

Browse files
Filter post pagination
1 parent a2ba7cb commit 5143645

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

lib/extras.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,20 @@ function bfg_viewport_value() {
8282
// }
8383

8484
return $defaults;
85+
} );
86+
87+
add_filter( 'wp_link_pages_args', function( $params ) {
88+
$params['before'] = '<ul class="post-pagination">';
89+
$params['after'] = '</ul>';
90+
return $params;
91+
} );
92+
93+
add_filter( 'wp_link_pages_link', function( $link ) {
94+
// var_dump( $link[1] );
95+
if ( $link && 'a' !== $link[1] ) {
96+
$link = '<li class="page-item active"><a href="#">' . $link . '</a></li>';
97+
} else {
98+
$link = '<li class="page-item">' . $link . '</li>';
99+
}
100+
return $link;
85101
} );

0 commit comments

Comments
 (0)