Skip to content

Instantly share code, notes, and snippets.

View arcticmouse's full-sized avatar

arcticmouse

View GitHub Profile
@arcticmouse
arcticmouse / gist:567e27dec2f9274f68667fcb06a05036
Created August 3, 2017 21:37
Wordpress Check for Featured Image : no more phantom images from has_post_thumbnail
$featured_image_url = wp_get_attachment_url( get_post_thumbnail_id( get_the_ID() ) );
if ( ! empty( $featured_image_url ) ) {
@arcticmouse
arcticmouse / scroll-back-to-top.js
Created February 24, 2017 23:54
Jquery floating scroll back to top of page button
//scroll back to the top of screen button
if ($('#back-to-top').length) {
var scrollTrigger = 100, // px
backToTop = function () {
var scrollTop = $(window).scrollTop();
if (scrollTop > scrollTrigger) {
$('#back-to-top').addClass('show');
} else {
$('#back-to-top').removeClass('show');
}
<?php
/**
* Convert a comma separated file into an associated array.
* The first row should contain the array keys.
*
* Example:
*
* @param string $filename Path to the CSV file
* @param string $delimiter The separator used in the file
* @return array