change order to fix the rendering of 'previous' and 'next' links
Merge pull request #3113 from xabbuh/issue-3110

change order to fix the rendering of 'previous' and 'next' links