Skip to content

Instantly share code, notes, and snippets.

@dsmy
dsmy / gulpfiles.js
Created October 28, 2016 15:30
roots.io with gulp.js
'use strict';
// TODO: better timing and size informations
// TODO: add sass sourcemaps
// TODO: bower wiredep
var gulp = require('gulp');
var del = require('del');
var $$ = require('gulp-load-plugins')();
@dsmy
dsmy / functions.php
Created October 31, 2017 18:59 — forked from yratof/functions.php
ACF OEmbed with thumbnails
<?php
/* Pull apart OEmbed video link to get thumbnails out*/
function get_video_thumbnail_uri( $video_uri ) {
$thumbnail_uri = '';
// determine the type of video and the video id
$video = parse_video_uri( $video_uri );
// get youtube thumbnail
@dsmy
dsmy / custom-meta.php
Created July 31, 2018 02:55
Custom Blog meta with author name outside of WordPress loop
if ( ! function_exists( 'atmosphere_posted_on' ) ) :
/**
* Prints HTML with meta information for the current post-date/time and author.
*/
function atmosphere_posted_on() {
global $post;
$author_id = $post->post_author;
$author = get_the_author_meta('display_name', $author_id);
$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {