• I want to build the usual line
    Titel of prev. posting ||Main||title of next post
    at the top of my single posting pages. This means: Not at the index.php but if someone clicks at the posting title or at “more…”, than he should see the line.
    Where should I write the code? I found this
    http://wordpress.org/support/3/14454
    in the forum, but this makes a database error.
    Thank you again!
    (Is this code correct for the line:
    <?php previous_post(‘%’,”); ?> || Start || <?php next_post(‘%’,”); ?>)

Viewing 6 replies - 1 through 6 (of 6 total)
  • You have to put the line inside the loop
    what database error you get anyway?

    Thread Starter herby007

    (@herby007)

    Thank you very much for this very quick answer!
    Yes, it works, if I put it in the loop – but then is the line also on the index page about every posting.
    Maybe I have any thing to do with this $single code???
    The database error, if I use the code from the earlyer posting, ist this (on the comment page):
    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 ‘ORDER BY post_date ASC LIMIT 0,1’ at line 1]
    SELECT ID,post_title FROM wpdez04_posts WHERE post_date > ” AND post_date < ‘2004-12-11 01:20:39’ AND post_status = ‘publish’ AND ID != ORDER BY post_date ASC LIMIT 0,1

    I suppose this will do it. This only comes up in single-post-display page.
    <?php if ( $single == true ) { ?>
    put that one line code here
    <?php } ?>

    Hmm. I have no problem running those functions outside the loop. Hmm…

    Thread Starter herby007

    (@herby007)

    Thank you again!
    Very strange – with “next_post” I get the database error – with “previous_post” not ..
    Okay, maybe is it a thing that I use WP 1.3 Alpha (10. dec.)?

    Thread Starter herby007

    (@herby007)

    yes, outside the loop it was okay for me too
    But it seems, I found the solution for my problem at this blog:
    http://john.qwertydigital.com/index.php?p=32
    Thank you again for all help!!!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘previous_post and next_post at the TOP of a page’ is closed to new replies.