$links = paginate_links( array(
'prev_next' => false,
'type' => 'array'
) );
if ( $links ) :
echo '<ul class="pagination">';
// get_previous_posts_link will return a string or void if no link is set.
if ( $prev_posts_link = get_previous_posts_link( __( 'Previous Page' ) ) ) :
echo '<li >';
echo $prev_posts_link;
echo '</li>';
endif;
echo '<li>';
echo join( '</li><li>', $links );
echo '</li>';
// get_next_posts_link will return a string or void if no link is set.
if ( $next_posts_link = get_next_posts_link( __( 'Next Page' ) ) ) :
echo '<li >';
echo $next_posts_link;
echo '</li>';
endif;
echo '</ul>';
endif;
'prev_next' => false,
'type' => 'array'
) );
if ( $links ) :
echo '<ul class="pagination">';
// get_previous_posts_link will return a string or void if no link is set.
if ( $prev_posts_link = get_previous_posts_link( __( 'Previous Page' ) ) ) :
echo '<li >';
echo $prev_posts_link;
echo '</li>';
endif;
echo '<li>';
echo join( '</li><li>', $links );
echo '</li>';
// get_next_posts_link will return a string or void if no link is set.
if ( $next_posts_link = get_next_posts_link( __( 'Next Page' ) ) ) :
echo '<li >';
echo $next_posts_link;
echo '</li>';
endif;
echo '</ul>';
endif;
Comments
Post a Comment