Skip to content

Instantly share code, notes, and snippets.

akudo shesgottadevelopit

View GitHub Profile
@shesgottadevelopit
shesgottadevelopit / ReadMe.md
Created Mar 6, 2020 — forked from patric-boehner/ReadMe.md
Single Post Navigation (Pagination)
View ReadMe.md

#Customize and display links to previous and next post, from a single post


This snippet is for displaying and customizing the links to previous and next posts, for single post entries within the Genesis Framework.

Normally the links to the previous and next post are displayed in the entry footer as the title of the next and previous posts. I wanted to customize the function to swap the link order so that the newest article was accessible from the link on the left and the previous article was accessible form the link on the right, to better navigate posts in an ascending order. I also wanted to add the text "Previous Post" and "next Post" above the linked post titles for better clarification. See the comment in the code for more detail.

For additional customizable permeates, see the codex links under References.

View mklink.sh
@shesgottadevelopit
shesgottadevelopit / validate_gravatar.php
Created Jul 14, 2016 — forked from justinph/validate_gravatar.php
In wordpress, a better way to check if an author has a gravatar or not. Sometimes you might want to check to see if a gravatar exists and not display any image if there isn't one. Uses the wordpress HTTP and caching apis. A better version of this: http://codex.wordpress.org/Using_Gravatars#Checking_for_the_Existence_of_a_Gravatar
View validate_gravatar.php
/**
* Utility function to check if a gravatar exists for a given email or id
* @param int|string|object $id_or_email A user ID, email address, or comment object
* @return bool if the gravatar exists or not
*/
function validate_gravatar($id_or_email) {
//id or email code borrowed from wp-includes/pluggable.php
$email = '';
You can’t perform that action at this time.