Instantly share code, notes, and snippets.

View fp5-speed-buttons.php
<?php
/*
Plugin Name: Flowplayer speed buttons
Plugin URI: https://gist.github.com/grappler/02b9d43c0606d74869a1
Description: Add buttons to adjust the speed of the video. The styles are added in the child theme
Version: 0.1.0
Author: Ulrich Pogson
Author URI: https://ulrich.pogson.ch/
License: GPLv2
License URI: http://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html
View Theme-review-links
View functions.php
<?php
/**
* Escaping for textarea values while leaving both double and single quotes unconverted.
*
* @param string $text
* @return string
*/
function theme_slug_esc_text( $text ) {
return htmlspecialchars( $text, ENT_NOQUOTES, get_option( 'blog_charset' ) );
}
View wpml-config.xml
<wpml-config>
<custom-types>
<custom-type translate="1">download</custom-type>
<custom-type translate="0">edd_payment</custom-type>
</custom-types>
<custom-fields>
<custom-field action="ignore">_edd_download_earnings</custom-field>
<custom-field action="ignore">_edd_download_sales</custom-field>
<custom-field action="copy">edd_price</custom-field>
<custom-field action="copy">edd_variable_prices</custom-field>
View functions.php
<?php
// add ie conditional html5 shim to header
function _s_add_ie_html5_shim () {
echo '<!--[if lt IE 9]>';
echo '<script src="' . get_template_directory_uri() . '/js/html5.js"></script>';
echo '<![endif]-->';
}
add_action('wp_head', '_s_add_ie_html5_shim');
View functions.php
<?php
function responsive_extended_mobile_menu_title( $page_title ) {
if ( is_front_page() ) {
$page_title = __( 'Home', 'responsive-mobile' );
} elseif ( is_home() ) {
$page_title = __( 'Blog', 'responsive-mobile' );
} elseif ( function_exists( 'is_woocommerce' ) && is_woocommerce() ) {
// @TODO Display porudct name on single product page
$page_title = woocommerce_page_title();
} elseif ( is_archive() ) {
View child-functions.php
<?php
/**
* Enqueue scripts and styles.
*/
function presentation_lite_parent_scripts() {
wp_enqueue_style( 'presentation-lite-parent-style', get_template_directory_uri() . '/style.css' );
}
add_action( 'wp_enqueue_scripts', 'presentation_lite_parent_scripts', 9 );
View header.php
<?php
/**
* The header for our theme.
*
* Displays all of the <head> section and everything up till <div id="content">
*
* @package _s
*/
?><!DOCTYPE html>
<html <?php language_attributes(); ?>>
View version-1.php
<?php
add_action( 'wp_enqueue_scripts', 'grappler_scripts' );
function grappler_scripts() {
wp_enqueue_style( 'grappler-style', get_template_directory_uri() . '/output/style.css' );
if ( is_child_theme() ) {
wp_enqueue_style( 'grappler-child-style', get_stylesheet_uri() );
}
View load-child-theme.php
<?php
/*
* Load parent theme translations
*/
add_action( 'after_setup_theme', 'woo_load_textdomain', 10 );
function woo_load_textdomain(){
$locale = get_locale();
$domain = 'woothemes';