%s',
'←',
__( 'Previous', 'applica' )
);
$next_text = sprintf(
'%s %s',
__( 'Next', 'applica' ),
'→'
);
$posts_pagination = get_the_posts_pagination(
array(
'mid_size' => 1,
'prev_text' => $prev_text,
'next_text' => $next_text,
)
);
// If we're not outputting the previous page link, prepend a placeholder with `visibility: hidden` to take its place.
if ( strpos( $posts_pagination, 'prev page-numbers' ) === false ) :
$posts_pagination = str_replace( '', '
' . $prev_text . '', $posts_pagination );
endif;
// If we're not outputting the next page link, append a placeholder with `visibility: hidden` to take its place.
if ( strpos( $posts_pagination, 'next page-numbers' ) === false ) :
$posts_pagination = str_replace( '
', '
' . $next_text . ' ', $posts_pagination );
endif;
if ( $posts_pagination ) :
echo $posts_pagination; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- already escaped during generation.
endif;
else:
// Default Pagination
$prev_text = sprintf(
'%s %s',
'←',
__( 'Older Posts', 'applica' )
);
$next_text = sprintf(
'%s %s',
'→',
__( 'Newer Posts', 'applica' )
);
the_posts_navigation(array(
'prev_text' => $prev_text,
'next_text' => $next_text,
));
endif;
?>