'; the_posts_pagination( array( 'mid_size' => 2, 'prev_text' => esc_html__( 'Prev', 'nightingale' ), 'next_text' => esc_html__( 'Next', 'nightingale' ), ) ); echo ''; } /** * Add in a previous and next functionality */ function nightingale_get_prev_next() { echo ''; } /** * Add in a method to go backwards and forwards between posts. * * @param array $args the arguments coming in to the function. * * @return string the output. */ function nightingale_the_post_navigation( $args = array() ) { $args = wp_parse_args( $args, array( 'prev_text' => 'Previous : %title ', 'next_text' => 'Next : %title ', 'in_same_term' => false, 'excluded_terms' => '', 'taxonomy' => 'category', 'screen_reader_text' => __( 'Post navigation', 'nightingale' ), ) ); $navigation = ''; $previous = get_previous_post_link( '
  • %link
  • ', $args['prev_text'], $args['in_same_term'], $args['excluded_terms'], $args['taxonomy'] ); $next = get_next_post_link( '
  • %link
  • ', $args['next_text'], $args['in_same_term'], $args['excluded_terms'], $args['taxonomy'] ); // Only add markup if there's somewhere to navigate to. if ( $previous || $next ) { $navigation = $previous . $next; } return $navigation; }