Title: Next post function: something wrong?
Last modified: August 18, 2016

---

# Next post function: something wrong?

 *  gaius_mohaim
 * [22 years, 11 months ago](https://wordpress.org/support/topic/next-post-function-something-wrong/)
 * Something’s wrong the the function php next_post() … the file breaks after the
   tag and nothing is displayed after that. Something wrong with coding my single-
   page template, or something like that?

Viewing 7 replies - 1 through 7 (of 7 total)

 *  [orbert](https://wordpress.org/support/users/orbert/)
 * (@orbert)
 * [22 years, 11 months ago](https://wordpress.org/support/topic/next-post-function-something-wrong/#post-22603)
 * Please post the function call as it appears in your template.
    (Remember to replace“
   <” with “&lt;”.)
 *  Thread Starter Anonymous
 * [22 years, 11 months ago](https://wordpress.org/support/topic/next-post-function-something-wrong/#post-22604)
 * Same old thing, I know it’s in the b2 loop or else it wouldn’t know head or tail,
   i just put it there as is:
    <?php next_post() ;?> I tried to remove the semicolon
   before the >, no diff. I thought I could put it after the content of the blog,
   but the comments don’t display… basicaly a broken file.
 *  [Guido](https://wordpress.org/support/users/guido/)
 * (@guido)
 * [22 years, 11 months ago](https://wordpress.org/support/topic/next-post-function-something-wrong/#post-22605)
 * I tried to find the culprit by looking through function next_post() in b2template.
   functions.php
    when I remove the @ at line 660, become: <snipp) $nextpost = $
   wpdb->get_row(“ </snipp> the error now shown: Fatal error: Call to a member function
   on a non-object in /usr/home/guido/ public_html/x/b2-include/b2template.functions.
   php on line 660 Perhaps it’s because no $wpdb was declared nor initialized inside
   the function next_post()
 *  Thread Starter Anonymous
 * [22 years, 11 months ago](https://wordpress.org/support/topic/next-post-function-something-wrong/#post-22607)
 * well, i guess that’s the problem… mike, matt, any help on this?
 *  Thread Starter Anonymous
 * [22 years, 11 months ago](https://wordpress.org/support/topic/next-post-function-something-wrong/#post-22608)
 * stupid me… guido… would that be the problem, or the solution? and where do i 
   put it?
 *  Thread Starter Anonymous
 * [22 years, 11 months ago](https://wordpress.org/support/topic/next-post-function-something-wrong/#post-22610)
 * yahoo it works. thanks guido.
 *  [Mike Little](https://wordpress.org/support/users/mikelittle/)
 * (@mikelittle)
 * [22 years, 11 months ago](https://wordpress.org/support/topic/next-post-function-something-wrong/#post-22618)
 * Fixed and commited to CVS
    Thanks Mike

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Next post function: something wrong?’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 7 replies
 * 4 participants
 * Last reply from: [Mike Little](https://wordpress.org/support/users/mikelittle/)
 * Last activity: [22 years, 11 months ago](https://wordpress.org/support/topic/next-post-function-something-wrong/#post-22618)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
