Skip to content

Instantly share code, notes, and snippets.

View marksuarez's full-sized avatar

Mark Suarez marksuarez

View GitHub Profile
@marksuarez
marksuarez / infinite-previous-next-looping.php
Created August 1, 2018 16:06 — forked from banago/infinite-previous-next-looping.php
Infinite next and previous post looping in WordPress
<?php
/**
* Infinite next and previous post looping in WordPress
*/
if( get_adjacent_post(false, '', true) ) {
previous_post_link('%link', '&larr; Previous Post');
} else {
$first = new WP_Query('posts_per_page=1&order=DESC'); $first->the_post();
echo '<a href="' . get_permalink() . '">&larr; Previous Post</a>';
wp_reset_query();
@marksuarez
marksuarez / 0_reuse_code.js
Created June 12, 2017 18:20
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console