<?php
/**
* Posts navigation functions
*
* @package FreshWP WordPress Theme
* @copyright Copyright (C) 2025 ThemesDNA
* @license licennse URI, for example : http://www.gnu.org/licenses/gpl-2.0.html
* @author ThemesDNA <themesdna@gmail.com>
*/

if ( ! function_exists( 'freshwp_wp_pagenavi' ) ) :
function freshwp_wp_pagenavi() {
    ?>
    <nav class="navigation posts-navigation freshwp-clearfix" role="navigation">
        <?php wp_pagenavi(); ?>
    </nav><!-- .navigation -->
    <?php
}
endif;

if ( ! function_exists( 'freshwp_posts_navigation' ) ) :
function freshwp_posts_navigation() {
    if ( function_exists( 'wp_pagenavi' ) ) {
        freshwp_wp_pagenavi();
    } else {
        the_posts_navigation(array('prev_text' => esc_html__( 'Older posts &rarr;', 'freshwp' ), 'next_text' => esc_html__( '&larr; Newer posts', 'freshwp' )));
    }
}
endif;