You can now use your keyboard’s left and right arrow keys to browse a gallery! Just click on any photo in your gallery (like this one), and navigate to the next one with your keyboard. It’s a new feature that is automatically built in to each gallery.
However, the fun doesn’t stop there. With a little bit of eyelash-batting, I was able to get our dev team to share the secret. With a few simple theme hacks, you can now build left/right arrow navigation into your blog (you can see it in action at the Daily Sabs). To add the feature, just place the following bits of code to the "Page" template of your theme.
Directly above the </body> tag add this code:
<script type="text/javascript">
onsugarInitSlideKeys();
</script>
And then add links for previous and next by using the following bits of code (you can change the bit that says "Go Back" and "Go Forward" and can place these links anywhere below the <body> tag and above the script code):
<a id='slide_previous' href="?page={$page_previous_page}">Go Back</a>
<a id='slide_next' href="?page={$page_next_page}">Go Forward</a>
Save your theme, and you should be set!
Remember, this is just a fun hack and it make take some tweaks to get it working right. If you need a hand, drop us a line at help@onsugar.com.
