WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] next_post_link broken in 2.3, codex not updated (4 posts)

  1. mingofaust
    Member
    Posted 6 years ago #

    Hi, I'm using next_post_link as described in the Codex, and on upgrading to WP 2.3, it got broken. There is no information (that I can find) in the Codex on what to do.

    I am calling this:

    <?php next_post_link('%link', '< Next', FALSE, '25, 26, 27, 28, 29, 30'); ?>

    And I am getting this:

    WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND p.ID != 496 ORDER BY p.post_date ASC LIMIT 1' at line 1]
    SELECT p.ID, p.post_title FROM wp_posts AS p WHERE p.post_date > '2007-09-07 10:03:31' AND p.post_type = 'post' AND p.post_status = 'publish' AND p.ID NOT IN () AND p.ID != 496 ORDER BY p.post_date ASC LIMIT 1...

    etc.

    Anyone have a solution?

    Thanks,

    Danny.

  2. nadglobtrotter
    Member
    Posted 6 years ago #

    Hello, I have just upgraded to 2.3 and I have the same problem : the commands

    <?php previous_post_link(); ?>

    and

    <?php next_post_link(); ?>

    return respectively :

    WordPress database error: [Unknown column 'wp_posts.ID' in 'on clause']
    SELECT p.ID, p.post_title FROM wp_posts AS p INNER JOIN wp_post2lang p2l ON wp_posts.ID = p2l.post_id INNER JOIN wp_languages l ON p2l.language_id = l.language_id WHERE p.post_date < '2007-09-24 13:28:00' AND p.post_type = 'post' AND p.post_status = 'publish' AND l.language_id IN (1) ORDER BY p.post_date DESC LIMIT 1

    and

    WordPress database error: [Unknown column 'wp_posts.ID' in 'on clause']
    SELECT p.ID, p.post_title FROM wp_posts AS p INNER JOIN wp_post2lang p2l ON wp_posts.ID = p2l.post_id INNER JOIN wp_languages l ON p2l.language_id = l.language_id WHERE p.post_date > '2007-09-24 13:28:00' AND p.post_type = 'post' AND p.post_status = 'publish' AND p.ID != 160 AND l.language_id IN (1) ORDER BY p.post_date ASC LIMIT 1

    How can I fix the database? I tried running again the upgrade.php file, but it didn't change anything.

  3. nadglobtrotter
    Member
    Posted 6 years ago #

    Hello,

    Since I also have problems with Gengo plugin since I updated to 2.3, i just deactivated it to test a couple things... and what happened? The next and previous_post_links are not broken anymore...
    So my problem comes from Gengo, and not WP2.3.
    What about you mingofaust? are you using Gengo too?

  4. mingofaust
    Member
    Posted 6 years ago #

    I figured out my problem. I thought it was a result of the tag and cat changes in 2.3, but it was a result of exporting and importing my posts to a new install. The categories were added to the new install in alpha order, instead of their previous order, so their cat_ids were all different.

    My bad, again.

Topic Closed

This topic has been closed to new replies.

About this Topic