• I’m trying to make a simple pagination nav menu, using the following code:

    global $wp_query;
                        $total_pages = $wp_query->max_num_pages;
    
                        if($total_pages > 1) {
    
                            $current_page = max(1, get_query_var('paged'));
    
                            echo paginate_links(array(
                                'base'  =>  get_pagenum_link(1).'%_%',
                                'format'    =>  'page/%#%',
                                'current'   =>  $current_page,
                                'total'     =>  $total_pages,
                                'prev_next' =>  false,
                                'type'      =>  'list'
    
                            ));
                        }

    But when I click on a page link it’s referring me to:

    Not Found

    The requested URL /wptest/page/2 was not found on this server.

    I know that it’s probably something simple that I missed but I don’t know what is it.

    Tried changing the settings in ‘Reading’ and ‘Permalinks’ and still no go..

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator keesiemeijer

    (@keesiemeijer)

    does pagination work with other Multiple Posts Pagination functions: http://codex.wordpress.org/Pagination#Function_Reference

    without this:

    global $wp_query;
    $total_pages = $wp_query->max_num_pages;
    if($total_pages > 1) {
    // ...
    }

    Thread Starter eXalted

    (@exalted)

    Hi, I tried using
    posts_nav_link();
    but it’s still giving
    Not Found
    The requested URL /wptest/page/2/ was not found on this server.

    The same address as with the code that I posted.

    I’ll be very happy if this problem can be resolved.

    Thread Starter eXalted

    (@exalted)

    Sorry for the double post but it doesn’t allow me to edit.

    I found that when I change the paginate_links array value to:
    'format' => '?paged=%#%',
    and the “Permalinks Settings” to Default, the pagination works. However that makes the URLs ugly.

    When I change the permalink settings to “/%category%/%postname%/“, the post links become prettier – something like “localhost/wptest/entertainment/a-simple-text-post/” but they stop working.
    The pagination also stops working. What am I doing wrong?

    Thread Starter eXalted

    (@exalted)

    Triple post I know..

    I found what was causing the error.

    The solution was very simple – turning the _rewrite module_ of WAMP.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘paginate_links refers to “Not Found” page’ is closed to new replies.