Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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 / 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 February 13, 2013 19:54
Tucked corners with one element
/**
* Tucked corners with one element
From LeaVerou - love this!!
*/
html {
background: url('http://www.red-team-design.com/wp-content/uploads/2012/10/wood.png')
}
body {
@sthembi
sthembi / dabblet.css
Created February 13, 2013 16:56
Text-shadow for text outlines
/**
* Text-shadow for text outlines
*/
body{
background: #392d0b;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
}
#myelement {
@sthembi
sthembi / dabblet.css
Created February 13, 2013 16:10
Testing psuedo elements
/**
* Testing psuedo elements
*/
section {
width: 940px;
margin:0px 100px;
position:relative;
}
@sthembi
sthembi / remove_wp_width_height.php
Last active December 12, 2015 08:19
Remove image width and height declaration in WordPress
//add to functions.php
//remove inline width and height added to images
add_filter( 'post_thumbnail_html', 'remove_thumbnail_dimensions', 10 );
add_filter( 'image_send_to_editor', 'remove_thumbnail_dimensions', 10 );
// Removes attached image sizes as well
add_filter( 'the_content', 'remove_thumbnail_dimensions', 10 );
function remove_thumbnail_dimensions( $html ) {
$html = preg_replace( '/(width|height)=\"\d*\"\s/', "", $html );
return $html;
}
@sthembi
sthembi / dabblet.css
Created February 7, 2013 20:07
Testing psuedo elements
/**
* Testing psuedo elements
*/
section {
width: 940px;
margin:0px 100px;
position:relative;
}