Skip to content

Instantly share code, notes, and snippets.

@sthembi
sthembi / WordPress.gitignore
Created April 3, 2013 18:17
Wordpress.gitignore
#sample of gitignore for Wordpress project
.htaccess
wp-config.php
wp-content/uploads/
wp-content/blogs.dir/
wp-content/upgrade/
wp-content/backup-db/
wp-content/advanced-cache.php
wp-content/wp-cache-config.php
@sthembi
sthembi / dabblet.css
Created April 16, 2013 20:29
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
body {
background:#b7997f
}
.faded, .faded2 {
width: 100%;
@sthembi
sthembi / gist:8937786
Created February 11, 2014 16:02 — forked from kloon/gist:4228021
//Display Fields
add_action( 'woocommerce_product_after_variable_attributes', 'variable_fields', 10, 2 );
//JS to add fields for new variations
add_action( 'woocommerce_product_after_variable_attributes_js', 'variable_fields_js' );
//Save variation fields
add_action( 'woocommerce_process_product_meta_variable', 'variable_fields_process', 10, 1 );
function variable_fields( $loop, $variation_data ) {
?>
<tr>
@sthembi
sthembi / woocommerce-remove-from-price.php
Created February 12, 2014 02:54 — forked from BFTrick/woocommerce-remove-from-price.php
plugin to remove price for variable products in woocommerce
<?php
/**
* Plugin Name: WooCommerce Remove Variation "From: $XX" Price
* Plugin URI: https://gist.github.com/BFTrick/7643587
* Description: Disable the WooCommerce variable product "From: $X" price.
* Author: Patrick Rauland
* Author URI: http://patrickrauland.com/
* Version: 1.0
*
* This program is free software: you can redistribute it and/or modify
@sthembi
sthembi / list-item-loop.php
Created February 22, 2014 21:26
option-tree loop through list-items (wordpress)
if (function_exists('ot_get_option')) {
/* get the slider array */
$slides = ot_get_option('pageSlider', array());
if (!empty($slides)) {
foreach ($slides as $slide) {
echo '<li><img src="' . $slide['pageSliderImg'] . '" alt="' . $slide['title'] . '" /></a></li>';
@sthembi
sthembi / functions.php
Created February 28, 2014 11:26 — forked from claudiosanches/functions.php
woocommerce - remove tabs
<?php
/**
* Remove default product tabs.
*/
function cs_woocommerce_remove_default_tags( $tabs ) {
// Remove description tab.
if ( isset( $tabs['description'] ) ) {
unset( $tabs['description'] );
}
@sthembi
sthembi / gist:9729600
Created March 23, 2014 20:49
Remove WooCommerce version generator
function my_woocommerce_loaded_function() {
global $woocommerce;
remove_action( 'wp_head', 'wc_generator_tag' );
}
add_action( 'woocommerce_init', 'my_woocommerce_loaded_function' );
@sthembi
sthembi / dabblet.css
Created April 7, 2015 19:13
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
@sthembi
sthembi / feedly_export_saved_for_later
Last active September 21, 2015 04:44 — forked from bradcrawford/feedly_export_saved_for_later
Simple script that exports a users "Saved For Later" list out of Feedly as a JSON string
// Simple script that exports a users "Saved For Later" list out of Feedly
// as a JSON string.
//
// This was intended for use in the Google Chrome's "Inspector" tool so your
// mileage may vary if used in other contexts.
//
// Format of JSON is as follows:
// [
// {
// title: "Title",
@sthembi
sthembi / .htaccess
Created October 15, 2017 20:45 — forked from neverything/.htaccess
WordPress behind a reverse proxy.
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
#RewriteBase /blog/
RewriteBase /~accountname/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule . /blog/index.php [L]
RewriteRule . /~accountname/index.php [L]