Skip to content

Instantly share code, notes, and snippets.

View Firestorm-Graphics's full-sized avatar

Firestorm Graphics Firestorm-Graphics

View GitHub Profile
@mikejolley
mikejolley / gist:1425282
Created December 2, 2011 23:12
This snippet lets you edit the icon for the PayPal gateway in WooCommerce.
add_filter('woocommerce_paypal_icon', 'custom_woocommerce_paypal_icon')
function custom_woocommerce_paypal_icon( $url ) {
$url = 'http://yoursite,com/youriconurl.png';
return $url;
}
@mikejolley
mikejolley / functions.php
Last active April 23, 2018 13:31
WooCommerce - Custom tracking code
add_action( 'woocommerce_thankyou', 'my_custom_tracking' );
function my_custom_tracking( $order_id ) {
// Lets grab the order
$order = wc_get_order( $order_id );
/**
* Put your tracking code here
* You can get the order total etc e.g. $order->get_total();
@mikejolley
mikejolley / gist:1965933
Created March 3, 2012 12:50
WooCommerce payment gateway plugin base
<?php
/*
Plugin Name: WooCommerce <enter name> Gateway
Plugin URI: http://woothemes.com/woocommerce
Description: Extends WooCommerce with an <enter name> gateway.
Version: 1.0
Author: WooThemes
Author URI: http://woothemes.com/
Copyright: © 2009-2011 WooThemes.
@retlehs
retlehs / gist:2785401
Created May 25, 2012 02:17
Display YouTube thumbnail from embed URL
<?php
/**
* Display a thumbnail from YouTube based off the embed code saved in the
* video post format metabox used by the CF Post Formats plugin
*
* @link https://github.com/crowdfavorite/wp-post-formats
* @link http://stackoverflow.com/a/6382259
*/
global $post;
@Firestorm-Graphics
Firestorm-Graphics / functions.options.php (smof)
Last active December 1, 2015 11:51
Dynamic sidebars for use with ( custom metaboxes & fields for wordpress, https://github.com/jaredatch/Custom-Metaboxes-and-Fields-for-WordPress) along with smof options panel or options far,work by devin - Allows you to select how many automatically generated sidebars you want & select the sidebar of your choice per page from a metabox (cmb meta…
/* Author: Dan Beaven
* Company: Firestorm Graphics
* Web: http://firestorm-graphics.com
*/
* Released under the GPL license
* http://www.opensource.org/licenses/gpl-license.php
*
* This is an add-on for WordPress
* http://wordpress.org/
*
@Firestorm-Graphics
Firestorm-Graphics / sidebar_select.php
Created June 11, 2012 21:53 — forked from c3mdigital/sidebar_select.php
Sidebar Select Meta Box for cmb_meta_boxes
<?php
/**
* Adds a new sidebar_select field type to CMB Metaboxes
*
* Builds the select box from all registered sidebars.
* Use in themes to create per page or post layout options without having to create new templates
*
* @see https://github.com/jaredatch/Custom-Metaboxes-and-Fields-for-WordPress.git
*
*/
@Firestorm-Graphics
Firestorm-Graphics / foundation wp link pages
Created July 6, 2012 01:24
custom wp_link_pages() for Foundation
@awshout
awshout / foundation4-topbar-menu.php
Last active August 19, 2023 02:44
WordPress Menu & Walker for ZURB's Foundation 4 Top Bar
<?php
add_theme_support('menus');
/**
* Register Menus
* http://codex.wordpress.org/Function_Reference/register_nav_menus#Examples
*/
register_nav_menus(array(
'top-bar-l' => 'Left Top Bar', // registers the menu in the WordPress admin menu editor
'top-bar-r' => 'Right Top Bar'
@colegeissinger
colegeissinger / wptuts-upload-3.5-ready.js
Last active April 2, 2018 14:32
Integrating the WP Media Uploader, version 3.5, Into Your Theme With jQuery. Based off the original tut found on http://wp.tutsplus.com/tutorials/creative-coding/integrating-the-wp-media-uploader-into-your-theme-with-jquery/ But updated to use the 3.5 Media Uploader. While I'm not the biggest JavaScript nerd out there, I understand enough to get…
(function($) {
$(function() {
$.fn.wptuts = function(options) {
var selector = $(this).selector; // Get the selector
// Set default options
var defaults = {
'preview' : '.preview-upload',
'text' : '.text-upload',
'button' : '.button-upload',
};
<?php
add_theme_support('menus');
/*
http://codex.wordpress.org/Function_Reference/register_nav_menus#Examples
*/
register_nav_menus(array(
'top-bar-l' => 'Left Top Bar', // registers the menu in the WordPress admin menu editor
'top-bar-r' => 'Right Top Bar'
));