get_previous_posts_link example

$label = $pagination_arrow . $label;
    }
    $content = '';
    // Check if the pagination is for Query that inherits the global context     // and handle appropriately.     if ( isset( $block->context['query']['inherit'] ) && $block->context['query']['inherit'] ) {
        $filter_link_attributes = static function() use ( $wrapper_attributes ) {
            return $wrapper_attributes;
        };

        add_filter( 'previous_posts_link_attributes', $filter_link_attributes );
        $content = get_previous_posts_link( $label );
        remove_filter( 'previous_posts_link_attributes', $filter_link_attributes );
    } elseif ( 1 !== $page ) {
        $content = sprintf(
            '<a href="%1$s" %2$s>%3$s</a>',
            esc_url( add_query_arg( $page_key$page - 1 ) ),
            $wrapper_attributes,
            $label
        );
    }
    return $content;
}


}

/** * Displays the previous posts page link. * * @since 0.71 * * @param string $label Optional. Previous page link text. */
function previous_posts_link( $label = null ) {
    echo get_previous_posts_link( $label );
}

/** * Retrieves the post pages link navigation for previous and next pages. * * @since 2.8.0 * * @global WP_Query $wp_query WordPress Query object. * * @param string|array $args { * Optional. Arguments to build the post pages link navigation. * * @type string $sep Separator character. Default '&#8212;'. * @type string $prelabel Link text to display for the previous page link. * Default '&laquo; Previous Page'. * @type string $nxtlabel Link text to display for the next page link. * Default 'Next Page &raquo;'. * } * @return string The posts link navigation. */
Home | Imprint | This part of the site doesn't use cookies.