The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

posts_nav_link with permalink structure fails (18 posts)

  1. RichardF
    Posted 11 years ago #

    I have the standard permalink structure and have replaced %postname% with %post_id%: as follows /index.php/%year%/%monthnum%/%day%/%post_id%/. I'm able to access all of my pages with this structure.

    When I look at my home page which breaks at 10 posts - I can click on the next link and it takes me to /index.php/page/2/ - everything seems to work.

    When I look at a category page with more than 10 posts and click on the next link it also takes me to /index.php/page/2/ instead of /index.php/category/category-name/page/2/.

    I'm using IIS 6 on a W2003 server.

    It looks like posts_nav_link doesn't pick up permalink structure. By the way when I remove the permalink structure everything works ok.

    Any ideas?

  2. Alex Mills (Viper007Bond)
    Posted 11 years ago #

    What's your category permalink structure set to?

  3. RichardF
    Posted 11 years ago #


  4. RichardF
    Posted 11 years ago #

    I also checked the database table wp-options and both permalink_structure and category_base contain the structure above.

  5. liquilife
    Posted 11 years ago #

    I've got a similair issue. I posted another thread and someone pointed out this one so I thought I would add to this. My permalink ends up looking like:
    which gives me a 404 page not found. If I manually type in:
    it displays the next page.

    However, if I view an archive by date my permalink looks like this for the "next page":
    which works perfectly. I'm confused.

    My structure is pretty simple, in the WP permalinks options I have the structure field filled in like this:

    Everything works perfectly with the exception of the next page URL in the category archive. Has anyone figured out a solution yet? This seems like it would be a pretty large issue considering the amount of people who use permalinks and utilize the next page link. Is this more of an isolated issue to just a few?

  6. liquilife
    Posted 11 years ago #

    Is this a bug with wordpress? Or is there maybe something I can do to fix this?


  7. bobsta
    Posted 11 years ago #

    ok, im having the same problem.

    On the first page it seems to follow the permalinks ok. Infact I a address (www.shedonline.tk) and then upgraded to a (www.shedonline.net).

    My problem is the same. In the archives it doesnt follow the permalink. Infact it wont change. It will just display the old address.

    Please someone figure out this problem!
    thanks bobsta :P

  8. sanitizer
    Posted 11 years ago #

    I'm also having the problem with the permalink.

    When I look at my home page which breaks at 1 post and click on the next link it takes me to /page/2/index.php/ instead of /page/2/.

    I'm using Apache.

    btw, this is the http://www.family-improvement.com

  9. sanitizer
    Posted 11 years ago #


  10. svedman
    Posted 10 years ago #

    I have this problem too, with posts_nav_link not working with permalinks. All other permalinks work fine, the .htaccess file is correct.

    I'm using version 1.5.2.

    In Options, my WordPress address is:

    And my Blog address is:

    The Next Page URI looks like this:

    When it should look like this:

    So, apparently, posts_nav_link use the Blog address from Options when it should be using the WordPress address?

  11. nickyg622
    Posted 10 years ago #

    Apparently, it's the category name that causes this error. Try removing %category% from the permalink and it should work. This seems like a bug in wordpress to me.

  12. DaveReed
    Posted 10 years ago #

    I have a similar problem. The post_nav_link works fine on the category and archive pages. My problem is on the main page. When you click on the "Previous entries" link it goes to /page/2/ but loads the same entries as page 1. This continues on if you keep clicking the "previous entries" link.

    I'm running 1.5.2 with the Kubrick theme. I've played with the CSS, but the Kubrick files are basically untouched. Anyone had this happen?

  13. HansD
    Posted 10 years ago #

    I'm having the same problems with the next and previous links on a category page. Does anyone know a solution?

  14. timweber
    Posted 10 years ago #

    RichardF has described my situation perfectly. I'm running WP 2.0.2 on a Windows 2003 server. The only difference is in the format of the permalink structure I'm using:


  15. timweber
    Posted 10 years ago #

    P.S. My monthly archives exhibit the same behavior (i.e., the year and month -- e.g., /2006/02/ -- are left out of the URI generated for the Previous and Next links).

  16. micasuh
    Posted 10 years ago #

    Has anyone ever found a solution to this problem? I have the same one and none of these posts have come up with a solution.

  17. Stephane
    Posted 9 years ago #

    I got the same problem... Anyone found a solution?



  18. Gabismo
    Posted 9 years ago #

    I have solved the problem... ;)

    1. Open the file: /wp-includes/template-functions-links.php

    2. Search the line:

    $qstr = wp_specialchars($_SERVER['REQUEST_URI']);

    and replace it with:

    $qstr = $_SERVER['REQUEST_URI'].wp_specialchars($_SERVER['PATH_INFO']);

    Now the pagination is correct in index, archives and categories. One night to fix it. ;)

    PD: Please, if anybody can help me to delete duplicated and very similar posts with a plugin or a SQL Query let me know it in this topic: http://wordpress.org/support/topic/94567


Topic Closed

This topic has been closed to new replies.

About this Topic