2008 05/08

Metapost: previous entries won’t work

A friend of mine spotted the problem some months ago and I can’t still find a solution. The link “Previous Entries” at the bottom of the main page (home) doesn’t work, it gives a 404. I’ve googled it and checked at Wordpress.org forums, and it seems to be an issue for many people. I even left a comment on the forums and no reply (I love it). Anyway, I don’t want to change the permalink structure of the posts (what you can read @ the url box) because the one I have now is better for search engines. However, I understand that it’s a pain in the neck for readers, if you want to check previous entries. That’s why you can still check previous posts on the sidebar, also via the sidebar’s calendar and much better, if you subscribe to the blog via email or via RSS feeds, you won’t miss a thing.

I apologize for the inconvenience. But I don’t know how to fix it. :( I’d welcome a helping hand, though…

This work, unless otherwise expressly stated, is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.

15 Comments

  • hii elena

    i don’t know yet why but if you try to enter to this link: http://maberui.webs.upv.es/index.php/page/2/ it’s working.

    But in your link is not like that, the reference is this :
    http://maberui.webs.upv.es/index.php/page/2/

    If you can change the link to the link i’ve given you, the problem is solve ;)

    Good luck

  • jejejeje Excuse me, “the problem is solved”.

    It would be very worth if i could modify my comments because sometimes when i’m writting i don’t notice my mistakes but afterwards i see them in the page and i would like to change them :x

    PS: i hope my advice about the link could help you

    bye bye

  • @Ginger Hair: Hi Ginger, I’m afraid it’s not. I’ve already noticed the change in the link’s behavior, as a matter of fact it’s explained in the message I left @ Wordpress forum. But I can’t change it, since it’s ‘div’ code… which works for any page in the blog. When you get rid of the second Index.php in the url, yes, you get to the right place, and if you scroll down, then you’ll see ‘previous entries’ and that will work too. It’s just a problem that occurs when you want to go from page 1 (=main index) to page 2 (from page 2 to 3, nothing wrong happens and so on so forth). I tried to modify the link as you say, manually, and then the links to page 2, 3, etc don’t work, I just get page 1 again. I’ve read tons of threads discussing on the matter, and it only happens with a given type of permalink structure, which by the way I wouldn’t like to change. It might be a problem of WP 2.6 or UPV’s server…don’t really know but it’s a real pain in the neck. But thank you anyways!

  • [...] | Archive” link, where you can browse all the posts published here (as I already explained here, the previous entries link at the bottom of the main page won’t work, due to some sort of [...]

  • Fix: paging in Wordpress under IIS

    For the last few minutes, I have been trying to figure out why next_posts_link() did not work on a template for a clients’ blog, under IIS.

    I found a great tip, but I prefer standard functions over things that work.

    Then I found out under IIS, PHP returns a wrong value for $_SERVER["REQUEST_URI"]. The link to the previous page was index.php/Index.php/page/2/. Notice there are two “index.php” (for Windows, index and Index are just the same.)

    The real, working, clean and easy solution is to add a simple line of code in the clean_url() function in wp-includes/formatting.php:

    $url = str_replace(’index.php/Index.php’,'index.php’,$url);

    just put this at the beginning of the fuction before any “if Statements” only thing is you have to remember to do this again if you upgrade word press.

    Hope this helps you out.

    My Site http://blog.ebookzones.com you will see my PageNav now works great.

    Don

    • Hi Don,
      Thanks a lot for the tip!! I’m trying to figure out where exactly the code goes:
      Before function? within function? after function?
      Trial and error, maybe?

      function wptexturize($text) {
      global $wp_cockneyreplace;
      $next = true;
      $has_pre_parent = false;
      $output = ”;
      $curl = ”;
      $textarr = preg_split(’/(|\[.*\])/Us’, $text, -1, PREG_SPLIT_DELIM_CAPTURE);
      $stop = count($textarr);

      // if a plugin has provided an autocorrect array, use it
      if ( isset($wp_cockneyreplace) ) {
      $cockney = array_keys($wp_cockneyreplace);
      $cockneyreplace = array_values($wp_cockneyreplace);
      } else {

  • Hi looks like your in the wrong function see where I added the code just before the first if Statement in the clean_url function. look below.

    function clean_url( $url, $protocols = null, $context = ‘display’ ) {
    $original_url = $url;
    $url = str_replace(’index.php/Index.php’,'index.php’,$url);

    if (” == $url) return $url;
    $url = preg_replace(’|[^a-z0-9-~+_.?#=!&;,/:%@$*\'()\\x80-\\xff]|i’, ”, $url);
    $strip = array(’%0d’, ‘%0a’);
    $url = str_replace($strip, ”, $url);
    $url = str_replace(’;//’, ‘://’, $url);
    /* If the URL doesn’t appear to contain a scheme, we
    * presume it needs http:// appended (unless a relative
    * link starting with / or a php file).
    */
    if ( strpos($url, ‘:’) === false &&
    substr( $url, 0, 1 ) != ‘/’ && !preg_match(’/^[a-z0-9-]+?\.php/i’, $url) )
    $url = ‘http://’ . $url;

    // Replace ampersands and single quotes only when displaying.
    if ( ‘display’ == $context ) {
    $url = preg_replace(’/&([^#])(?![a-z]{2,8};)/’, ‘&$1′, $url);
    $url = str_replace( “‘”, ‘'’, $url );
    }

    if ( !is_array($protocols) )
    $protocols = array(’http’, ‘https’, ‘ftp’, ‘ftps’, ‘mailto’, ‘news’, ‘irc’, ‘gopher’, ‘nntp’, ‘feed’, ‘telnet’);
    if ( wp_kses_bad_protocol( $url, $protocols ) != $url )
    return ”;

    return apply_filters(’clean_url’, $url, $original_url, $context);
    }

  • Hi looks like your in the wrong function see where I added the code just before the first if Statement in the clean_url function. look below.

    function clean_url( $url, $protocols = null, $context = ‘display’ ) {
    $original_url = $url;
    $url = str_replace(’index.php/Index.php’,'index.php’,$url);

    if (” == $url) return $url;
    $url = preg_replace(’|[^a-z0-9-~+_.?#=!&;,/:%@$*\'()\\x80-\\xff]|i’, ”, $url);
    $strip = array(’%0d’, ‘%0a’);
    $url = str_replace($strip, ”, $url);
    $url = str_replace(’;//’, ‘://’, $url);
    /* If the URL doesn’t appear to contain a scheme, we

  • I went to the text tool and it doen’t show me the whole file can you just email the whole file save it as a txt or zip it and I edit it for you.

    Also yes I use WP 2.7 so we are good there. So you can’t find a function called “function clean_url” in your wp-includes/formatting.php you might want to check a freash verion on the file in the install package I have seen where some files don’t over write when you upgrade.

    Thanks
    Don

  • hi there i have the same issue here
    did u guys found the solution if so plz
    share it

  • Hi the fix is listed above if you have a PageNav issue where the index.php shows twice in the link.

    Don
    http://www.moneyhowtoday.com

  • hey, spring is cooming! good post there, tnx for efl20.com

Leave a Reply

copyright 2008-2009 E|FL 2.0 | The EFL20 Blog: TEFL, language learning, elearning2.0 and social web.


Using AcosminSIMPLE designed by Acosmin Premium