If you need a keyboard shortcut to open the preview in wordpress. Just add the function to your function.php
function add_custom_keyboard_shortcut_jquery() { ?> < script type=" text/javascript" > jQuery(document).keydown(function(event) { if ((event.metaKey || event.ctrlKey) & & event.which === 89) { event.preventDefault(); jQuery(' #post-preview' ).click(); } }); < /script> < ?php } add_action( ' admin_head-post.php' , ' add_custom_keyboard_shortcut_jquery' ); add_action( ' admin_head-post-new.php' , ' add_custom_keyboard_shortcut_jquery' );
With CMD+y on Mac or STRG+y on Windows will open the preview window quick.