In this article I share how get_adjacent_post() can be used to display links to previous and next entries on single Post pages and single entries of a particular 'movies' CPT in Genesis.
Summary:
a) The navigation links are going to remain fixed and always visible.
b) jQuery is used to calculate the number of pixels by which the previous and next entry links should be pushed off the screen edge (in regular state) in left and right directions respectively.
c) When hovered, the previous link will slide to the right to reveal the previous entry's title and the next link will slide to the left to reveal the next entry's title.
d) On handhelds (tablets and mobiles), the links will appear in the 'traditional' way: at the bottom of the entries.
Screenshots:
Screencast:
Step 1
Create a file named sitewide-non-handhelds.js in your child theme's js directory having the following:
To view the full content, please sign up for the membership.
Already a member? Log in below or here.
Hi Sridhar,
I would like this on my website, using the Parallax theme. I’ve tried to add your code to functions.php, but it disables the rest of the code in there. What could that be?
Also, Dashicons are already enqueued. So can those icons replace the Font Awesome icons?
Thanks.