Skip to content

Instantly share code, notes, and snippets.

@scofennell
scofennell / sjf_deh_get_exif_date.php
Last active August 29, 2015 14:01
WordPress Function to get EXIF date of attachment
<?php
/**
* Return the EXIF date for a jpeg attachment post.
*
* @return string The Exif time on which the image was taken.
*/
function sjf_deh_get_exif_date() {
// Grab the current post.
@scofennell
scofennell / sjf_deh_exif_add.php
Last active August 29, 2015 14:01
WordPress function to change post date to Exif date.
<?php
/**
* Hooks onto an attachment post just after it's created and alters the post date to reflect the EXIF time.
*
* @param int $attachment_ID The ID of the post we're altering.
* @return int The ID of the post we're altering.
*/
function sjf_deh_exif_add( $attachment_ID ) {
@scofennell
scofennell / skip-link.php
Last active August 29, 2015 14:06
HTML Skip Link for a WordPress blog.
@scofennell
scofennell / screen-reader.css
Created September 6, 2014 19:21
Screen Reader CSS
/* Assistive text */
.screen-reader-text {
position: absolute;
font-size: 0;
opacity: 0;
z-index: -1;
}
.screen-reader-text:active,
.screen-reader-text:focus {
@scofennell
scofennell / smooth-scroll-wp.php
Created September 6, 2014 19:44
WordPress function to smooth scroll internal links
<?php
/**
* Output JS to smooth scroll internal links
*/
function anchorage_smooth_scroll() {
?>
<script>
// Once the document is ready...
@scofennell
scofennell / wp-breadcrumbs-helpers.php
Last active August 29, 2015 14:08
WordPress function to create a breadcrumb nav.
<?php
/**
* Wrap the crumb.
* @see https://schema.org/breadcrumb
*/
if( ! function_exists( 'anchorage_get_breadcrumb' ) ) {
function anchorage_get_breadcrumb( $crumb_title, $crumb_link ) {
<?php
/**
* Get a breadcrumb nav.
*
* @return string A breadcrumb nav.
*
* @since anchorage 1.0
*/
@scofennell
scofennell / WordPress Function to Perform Plugin Update Routine.php
Created March 23, 2015 03:01
WordPress Function to Perform Plugin Update Routine
<?php
/**
* Establish a routine of tasks to perform when this plugin is updated.
*
* @package WordPress
* @subpackage sjf-et
* @since SJF ET 1.5.5
*/
@scofennell
scofennell / WordPress Function to Build a Transient Key.php
Last active August 29, 2015 14:17
WordPress Function to Build a Transient Key
<?php
/**
* Grab the transient key for a request.
*
* @param string $request_url The url for an http request to ecwid.
* @return string The transient key for an http request to ecwid.
*/
public function get_transient_key( $request_url ) {