wordpress f keys keyboard to navigation

Solutions on MaxInterview for wordpress f keys keyboard to navigation by the best coders in the world

showing results for - "wordpress f keys keyboard to navigation"
Hind
27 Feb 2019
1function my_custom_js() { ?>
2
3    <script type="text/javascript">
4        document.onkeydown = function (e) {
5            var e = e || event, 
6            keycode = e.which || e.keyCode; 
7            if (keycode == 37 || keycode == 33)
8                location = "<?php echo get_permalink(get_previous_post()); ?>";
9            if (keycode == 39 || keycode == 34)
10                location = "<?php echo get_permalink(get_next_post()); ?>";
11        }
12    </script>
13
14<?php }
15add_action('wp_footer', 'my_custom_js');