Forums

[resolved] posts_nav_link separater malfunction 3.2.1 (5 posts)

  1. rwheindl
    Member
    Posted 8 months ago #

    I have a bunch of posts to display with pagination. I tested a setup with 3 pages.

    I'm using:
    posts_nav_link(' | ', '« Previous', 'Next »');

    Page 1 and 3 properly display just Previous or Next, but page 2 does not show a separator:
    « PreviousNext »

    I also tried:
    posts_nav_link();

    And the default separater is also not showing:
    « Previous PageNext Page »

    Is this a bug in the latest version of WordPress?

  2. rwheindl
    Member
    Posted 8 months ago #

    Note, I disabled all plugins with same result. I'm customizing the starker's template.

    Here's the pastebin.

  3. rwheindl
    Member
    Posted 8 months ago #

    After some debugging, I've narrowed it down to something is wrong with the regular expression that processes the separator in the "wp-includes/link-template.php" file of WordPress, line 1716:

    $return .= preg_replace('/&([^#])(?![a-z]{1,8};)/i', '&$1', $args['sep']);

    But in trying to figure out what the developer(s) originally intended, I'm at a loss.

    The first thing I notice is & should probably be & as every place I look around the internet doesn't show it with a zero. And, what's the $1 for?

    Next, why's there a carat(^) in the character class after the initial ampersand? I've not seen anything in HTML with &^555; before.

    Can anyone with regex experience provide some insight?

  4. rwheindl
    Member
    Posted 8 months ago #

    Okay, since the HTML is messing up the presentation of my notes, I'm adding some spaces:

    & # 0 3 8 ; should probably be & # 3 8 ;

  5. rwheindl
    Member
    Posted 8 months ago #

    Got it, I was missing 'paged'=>$paged in my arguments for query_posts();

Reply

You must log in to post.

About this Topic