Skip to content

Instantly share code, notes, and snippets.

View peterhartree's full-sized avatar

Peter Hartree peterhartree

View GitHub Profile
@peterhartree
peterhartree / wp-capitalise-term-title.php
Created August 10, 2014 14:24
WordPress: Capitalise term title
/**
* Capitalises the first letter of term title for display.
*/
function capitalise_term_titles( $term_obj ) {
$term_obj->name = ucfirst($term_obj->name);
return $term_obj;
}
add_filter( 'get_term', 'capitalise_term_titles' );
/**
* @extends \WC_Email
*/
class WC_Custom_Order_Email extends WC_Email {
/**
* Set email defaults
*/
public function __construct() {
@peterhartree
peterhartree / wordpress-headlines.php
Last active December 28, 2015 12:29
How to use the SimplePie RSS library to display a list of linked article headlines from a Wordpress RSS feed on a non-Wordpress PHP page.
<?php
/** Outputs a list of linked article headlines from a Wordpress recent posts RSS feed. */
$simplepie_path = "includes/simplepie/"; // path to SimplePie RSS library
$feed_url = 'http://yourblog.com/feed/'; // url of your blog's RSS feed
$cache_location = $_SERVER['DOCUMENT_ROOT'] . '/includes/simplepie-cache'; // set cache directory (make sure that the directory exists and that this script can write to it)
$max_items = 3; // max feed items to show
$first_item = 0; // feed item to start from
require_once($simplepie_path.'autoloader.php');
h1,h2,h3,h4,h5,h6,em,.sok_font{font-family:"switchedonkidsnormal",Arial;text-transform:none;letter-spacing:0px;font-weight:normal;line-height:1.2;color:#fff; -webkit-text-fill-color:#fff;-webkit-text-stroke:1px #000;text-fill-color:#fff;text-stroke:1px #000}
@peterhartree
peterhartree / textstroke.js
Created June 10, 2013 13:12
Text-stroke feature detect for use with Modernizr.js
/*!
{
"name": "CSS text-stroke",
"property": "text-stroke",
"caniuse": "css-text-stroke",
"tags": ["css"],
"knownBugs": ["None"]
}
!*/