• Hiya,
    Here’s my suggestion for how to make the posts_paged option look good with a site that has permalinks enabled. It’s a change to the URL generation code inside wp-includes/template-functions-posts.php and it correctly adds the separator depending on the existance previous GET parameters (like a search, when ? will already have been included in the URL):
    357c357
    < $qstr = $_SERVER['REQUEST_URI'];
    ---
    > $qstr = $_SERVER['QUERY_STRING'];
    373,379c373,375
    < echo get_settings('home') . $qstr;
    < if (strpos($qstr,'?') === FALSE) {
    < echo $querystring_start;
    < } else {
    < echo $querystring_separator;
    < }
    < echo 'paged'.$querystring_equal.$nextpage;
    ---
    > echo get_settings('home') .'/'.$pagenow.$querystring_start.
    > ($qstr == '' ? '' : $qstr.$querystring_separator) .
    > 'paged'.$querystring_equal.$nextpage;
    414c410
    < $qstr = $_SERVER['REQUEST_URI'];
    ---
    > $qstr = $_SERVER['QUERY_STRING'];
    429,435c425,427
    < echo get_settings('home') . $qstr;
    < if (strpos($qstr,'?') === FALSE) {
    < echo $querystring_start;
    < } else {
    < echo $querystring_separator;
    < }
    < echo 'paged'.$querystring_equal.$nextpage;
    ---
    > echo get_settings('home') .'/'.$pagenow.$querystring_start.
    > ($qstr == '' ? '' : $qstr.$querystring_separator) .
    > 'paged'.$querystring_equal.$nextpage;

    Basically, change the QUERY_STRING to REQUEST_URI so we don’t have to figure out where in the permalinks we are, and then a (messy) if..then block that could be shrunk down to a ? line (I think) that decides if we need a ? or an & before the paged value.
    Hope that helps someone !

    ian.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘diff for posts_paged with permalinks’ is closed to new replies.