I'm building my site on localhost and I'd like to navigate to next and previous posts by using keyboard right and left arrow keys.
I know about the WP functions
get_previous_post, but since I'm new to this I don't know how to use them.
I found this code and placed it in the header of the site
the good thing is that by pressing the left/right arrows something happen, the bad thing is that the previous/next posts are not loaded, something like
http://localhost/testsite/%3C?php%20echo%20get_permalink(get_next_post());%20?%3E is loaded instead.
How could this be fixed?