Title: nextprev.php and private posts
Last modified: August 30, 2016

---

# nextprev.php and private posts

 *  [Inva_](https://wordpress.org/support/users/inva_/)
 * (@inva_)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/nextprevphp-and-private-posts/)
 * Hi !
 * I’m using the free version of Optimizer on a small website, and we have numerous
   posts that are private. At the bottom of all posts, we can see the Next and Previous
   post (generated through the nextprev.php file).
    Problem is, when a post is private,
   the WordPress methods get_previous_post and get_next_post return an empty string,
   and a blank space is printed, which is supposed to say that there is no previous
   post. I’ve unsuccessfully tried to find a fix, so if anyone can help with making
   get_previous/next_post jumping to the previous/next non private post, that’d 
   be marvelous !
 * Thx !

Viewing 1 replies (of 1 total)

 *  Theme Author [OptimizerWP](https://wordpress.org/support/users/layerthemes/)
 * (@layerthemes)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/nextprevphp-and-private-posts/#post-6237270)
 * Hi
 * Can you please post your site address here?
 * Thanks

Viewing 1 replies (of 1 total)

The topic ‘nextprev.php and private posts’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/optimizer/0.7.4/screenshot.png)
 * Optimizer
 * [Support Threads](https://wordpress.org/support/theme/optimizer/)
 * [Active Topics](https://wordpress.org/support/theme/optimizer/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/optimizer/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/optimizer/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [OptimizerWP](https://wordpress.org/support/users/layerthemes/)
 * Last activity: [10 years, 11 months ago](https://wordpress.org/support/topic/nextprevphp-and-private-posts/#post-6237270)
 * Status: not resolved