Skip to content

Instantly share code, notes, and snippets.

View DanielSantoro's full-sized avatar

Danny Santoro DanielSantoro

View GitHub Profile
@DanielSantoro
DanielSantoro / gist:b386934f8502f0077dea
Created July 7, 2014 15:17
Show Options Page in "Settings" Section
// Adds "All Settings" link in the Settings Tab for Admins
function all_settings_link() {
add_options_page(__('All Settings'), __('All Settings'), 'administrator', 'options.php');
}
add_action('admin_menu', 'all_settings_link');
@DanielSantoro
DanielSantoro / functions.php
Created July 18, 2014 15:40
Only display minimum price for WooCommerce variable products
/**
* Only display minimum price for WooCommerce variable products
**/
add_filter('woocommerce_variable_price_html', 'custom_variation_price', 10, 2);
function custom_variation_price( $price, $product ) {
$price = '';
@DanielSantoro
DanielSantoro / functions.php
Created July 18, 2014 15:45
Only display maximum price for WooCommerce variable products
/**
* Only display maximum price for WooCommerce variable products
**/
add_filter('woocommerce_variable_price_html', 'custom_variation_price', 10, 2);
function custom_variation_price( $price, $product ) {
$price = '';
$price .= woocommerce_price($product->max_variation_price);
@DanielSantoro
DanielSantoro / Zephyr-Nav-to-Top
Created August 8, 2014 15:24
Move Zephyr navigation to the top of the page
/* Zephyr Navigation to Top */
.site-header {
top: 0;
bottom: inherit;
}
.footer {
padding: 2.618em 0 1.874em;
}
.main.fullwidth, .layout-full .main, .col-full {
padding-top: 1.4em;
@DanielSantoro
DanielSantoro / functions.php
Created August 18, 2014 17:57
Mystile default `functions.php` - as of 8/18/14
<?php
// File Security Check
if ( ! empty( $_SERVER['SCRIPT_FILENAME'] ) && basename( __FILE__ ) == basename( $_SERVER['SCRIPT_FILENAME'] ) ) {
die ( 'You do not have sufficient permissions to access this page!' );
}
?>
<?php
/*-----------------------------------------------------------------------------------*/
/* Start WooThemes Functions - Please refrain from editing this section */
@DanielSantoro
DanielSantoro / functions.php
Created October 29, 2014 14:03
Move Canvas Theme Navigation to Top
// Moves Main Navigation to the top of the header
add_action( 'wp', 'tweak_nav_layout' );
function tweak_nav_layout() {
remove_action( 'woo_header_after','woo_nav', 10 );
add_action( 'woo_header_before','woo_nav', 10 );
}
@DanielSantoro
DanielSantoro / canvas-sticky-footer.css
Created November 15, 2014 01:03
Canvas Sticky Footer
@DanielSantoro
DanielSantoro / woo.js
Last active August 29, 2015 14:10
community
/*
* jQuery v1.9.1 included. Go allllll the way down
*/
$(document).ready(function() {
// Removes first 3 chars from Topics list - By Jeff Pearce
function setCharAt(str,index,chr) {
if(index > str.length-1) return str;
return str.substr(0,index) + chr + str.substr(index+1);
@DanielSantoro
DanielSantoro / insert.php
Created December 2, 2014 16:33
PYS Insert function
<?php
/* Add CSS */
add_action( 'wp_enqueue_scripts', 'pys_css', 40 );
function pys_css() {
wp_register_style( 'pys-style', plugins_url('pys-style.css', __FILE__) );
wp_enqueue_style( 'pys-style' );
}
@DanielSantoro
DanielSantoro / wc_order_status_styling.php
Created December 4, 2014 16:12
Change Order Status Icon Color (Version 2!)
function wc_order_status_styling() {
echo '<style>
.widefat .column-order_status mark.on-hold:after, .widefat .column-order_status mark.completed:after, .widefat .column-order_status mark.cancelled:after, .widefat .column-order_status mark.processing:after {
font-size: 2em;
}
/* Processing Ellipsis */
.widefat .column-order_status mark.processing:after {
color: #2529d7;
}
/* On-Hold Dash */