Created
September 10, 2012 18:07
-
-
Save whyisjake/3692615 to your computer and use it in GitHub Desktop.
wp_link_pages
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php $args = array( | |
'before' => '<div id="nav-buttons">', | |
'after' => '</div>', | |
'link_before' => '', | |
'link_after' => '', | |
'next_or_number' => 'next', | |
'nextpagelink' => __('<span class="carousel-control new next" style="font-size:60px;">›</span>'), | |
'previouspagelink' => __('<span class="carousel-control new prev" style="font-size:60px;">‹</span>'), | |
'pagelink' => '%', | |
'echo' => 1 | |
); | |
?> | |
<?php wp_link_pages($args); ?> | |
<script type="text/javascript"> | |
var entryPermalink = '<?php the_permalink(); ?>'; | |
jQuery(document).ready(function(){ | |
// close window and return to article when clicking close button | |
jQuery('#return-link').click(function() { | |
window.opener.document.location.href = entryPermalink; | |
window.close(); | |
return false; | |
}); | |
jQuery('a span.badge').addClass('badge-info'); | |
jQuery('#nav-buttons a:first-child ').addClass('prev'); | |
jQuery('#nav-buttons a:last-child').addClass('next'); | |
jQuery(document).bind('keydown', 'left', function() { | |
var url = jQuery('.prev').attr('href'); | |
console.log(url); | |
if (url) { | |
window.location = url; | |
} | |
}); | |
jQuery(document).bind('keydown', 'right', function() { | |
var url = jQuery('.next').attr('href'); | |
console.log(url); | |
if (url) { | |
window.location = url; | |
} | |
}); | |
}); | |
</script> | |
<?php function make_slideshow_hotkeys() { | |
wp_enqueue_script( | |
'hotkeys', | |
get_template_directory_uri() . '/js/jquery.hotkeys.js', | |
array('jquery') | |
); | |
} | |
add_action('wp_enqueue_scripts', 'make_slideshow_hotkeys'); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment