Through the keyboard to see the next article is not very convenient, this is actually a keyboard corresponding to the ASCII code to achieve, such as the right and left arrow keys corresponding to the ASCII code is 37 and 39, the following to see how to achieve this function:
1. Load the Jqury library, of course, many of the themes themselves have been loaded, if not add one on their own, many ways on the web, I will no longer say.
2. Add the following code to the footer.php before you can
1 |
<script>$(document).keydown(
function
(e){
if
(e.keyCode==37){
var rnt = $(
‘a[rel="next"]‘
);
if (rnt.length > 0){ location.href = rnt.attr(
‘href‘
); }; };
if
(e.keyCode==39){
var rpv = $(
‘a[rel="prev"]‘
);
if (rpv.length > 0){ location.href = rpv.attr(
‘href‘
); }; };});</script>
|
Below you can use the keyboard on the left and right keys to achieve the article to view the next page, very convenient.
PS: Note that some websites may have an impact on this feature if they use some cache plugins.
WordPress use keyboard left and RIGHT arrow keys to view the previous and next article