Skip to content

Instantly share code, notes, and snippets.

View lancewillett's full-sized avatar

Lance Willett lancewillett

View GitHub Profile
@lancewillett
lancewillett / parse-csv.php
Last active July 28, 2017 14:37
PHP: parse a CSV formatted file (comma-delimited)
<?php
/**
* This file is use to parse a CSV formatted file (comma-delimited).
*/
// File should be first and only argument.
if ( empty( $argv[1] ) ) {
die( 'Please supply at least one filename.' );
}
@lancewillett
lancewillett / footer-date.php
Created May 2, 2017 16:02
Keep your website footer copyright year always up-to-date with PHP
@lancewillett
lancewillett / gist:7491863
Created November 15, 2013 21:22
Sample welcome screen
<?php
/**
* Output Twenty Fourteen welcome panel content.
*
* @return void
*/
function twentyfourteen_welcome_panel() {
?>
<p class="about-description">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas sed diam eget risus varius blandit sit amet non magna. Aenean lacinia bibendum nulla sed consectetur.
DELETE FROM wp_comments WHERE comment_approved = '0';
@lancewillett
lancewillett / gist:6907979
Last active December 25, 2015 03:09
3.7 release, evaluating new default theme bumps
Twenty Thirteen, several important bug fixes
I think this one definitely needs a bump and release with 3.7
http://core.trac.wordpress.org/log/trunk/src/wp-content/themes/twentythirteen/
Twenty Twelve, a few bug fixes (and minor code comment changes)
I suggest a bump and release with 3.7
http://core.trac.wordpress.org/log/trunk/src/wp-content/themes/twentytwelve/
Twenty Eleven, 1 needed bug fix for mobile (and minor code comment changes)
I suggest a bump and release with 3.7
@lancewillett
lancewillett / gist:6427469
Last active December 22, 2015 05:58
List of websites running Further and also having a custom header image.
http://monaandchris.com/
http://deddinordiawan.com/
http://meetdux.com/
http://chelseano5.com/
http://strollwithoutshoes.com/
http://bikinibodypro.wordpress.com/
http://robertofrugone.com/
http://insendems.wordpress.com/
http://designmatters.iida.org/
http://madhyperecords.com/
@lancewillett
lancewillett / gist:6178854
Created August 7, 2013 21:23
P2 fix comment toggle issue, should only be on non-singular pages
Index: p2/inc/js.php
===================================================================
--- p2/inc/js.php (revision 14979)
+++ p2/inc/js.php (working copy)
@@ -271,7 +271,7 @@
$('.commentlist').show();
$('.discussion').hide();
}
- <?php if ( (int) $hide_threads ) : ?>
+ <?php if ( (int) $hide_threads && ! is_singular() ) : ?>
/*
Theme Name: Your Theme Name
Theme URI: Your Theme URL
Author: Your Name
Author URI: Your URL
Description: Describe your theme and its features.
Version: Your Theme's Version Number
License: GNU General Public License
License URI: license.txt
Tags: insert tags to describe your theme to help users search for it. Find the list of tags at: http://wordpress.org/extend/themes/about/
<a href="http://wordpress-trunk:8888/about/clearing-floats/olympus-digital-camera/"><img src="http://wordpress-trunk:8888/wp-content/uploads/2012/07/manhattansummer.jpg" width="640" height="480" alt="OLYMPUS DIGITAL CAMERA" class="wp-image-827 alignnone size-large" /></a>
<video class="wp-video-shortcode" id="video-975-1" width="724" height="360" controls="controls" preload="none"><source type="video/m4v" src="http://wordpress-trunk:8888/wp-content/uploads/2013/03/merge-1.m4v" /><source type="" src="http://wordpress-trunk:8888/?attachment_id=976" /><a href="http://wordpress-trunk:8888/wp-content/uploads/2013/03/merge-1.m4v">http://wordpress-trunk:8888/wp-content/uploads/2013/03/merge-1.m4v</a></video> </div>