Help With A Reverse Pagination Plugin

This function will give you a url for a page number without stripping the url for page 1:

function get_pagenum_link_full($pagenum = 1, $escape = true ) {
    global $wp_rewrite;
    $pagenum = (int) $pagenum;
    $request = remove_query_arg( 'paged' );
    $home_root = parse_url(home_url());
    $home_root = ( isset($home_root['path']) ) ? $home_root['path'] : '';
    $home_root = preg_quote( $home_root, '|' );
    $request = preg_replace('|^'. $home_root . '|i', '', $request);
    $request = preg_replace('|^/+|', '', $request);
    if ( !$wp_rewrite->using_permalinks() || is_admin() ) {
        $base = trailingslashit( get_bloginfo( 'url' ) );
        $result = add_query_arg( 'paged', $pagenum, $base . $request );
    }
}

Modified from the original code for get_pagenum_link() as defined here http://phpxref.ftwr.co.uk/wordpress/wp-includes/link-template.php.source.html#l1408

get_pagenum_link_full(1); will give you something like http://www.url.com/category/page/1 depending on your permalink settings.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)