Fixes PHP notices when prev/next post doesn't exist