Skip to content

Instantly share code, notes, and snippets.

View binzorellino's full-sized avatar

Imre T. B. binzorellino

View GitHub Profile
/* ----------------------------------------------------------------------------------------------------
Super Form Reset
A couple of things to watch out for:
- IE8: If a text input doesn't have padding on all sides or none the text won't be centered.
- The default border sizes on text inputs in all UAs seem to be slightly different. You're better off using custom borders.
- You NEED to set the font-size and family on all form elements
- Search inputs need to have their appearance reset and the box-sizing set to content-box to match other UAs
@joelambert
joelambert / README
Created June 1, 2011 11:03
Drop in replacements for setTimeout()/setInterval() that makes use of requestAnimationFrame() where possible for better performance
Drop in replace functions for setTimeout() & setInterval() that
make use of requestAnimationFrame() for performance where available
http://www.joelambert.co.uk
Copyright 2011, Joe Lambert.
Free to use under the MIT license.
http://www.opensource.org/licenses/mit-license.php
@mikejolley
mikejolley / gist:1860056
Created February 18, 2012 16:27
WooCommerce - Override billing fields
add_filter( 'woocommerce_billing_fields', 'custom_woocommerce_billing_fields' );
function custom_woocommerce_billing_fields( $fields ) {
// Over-ride a single label
$fields['billing_first_name']['label'] = 'Your label';
// Over-ride a single required value
$fields['billing_first_name']['required'] = false;
@luetkemj
luetkemj / wp-query-ref.php
Last active May 25, 2024 10:56
WP: Query $args
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.github.io
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php
*/
@mikejolley
mikejolley / gist:2044109
Last active April 10, 2024 13:17 — forked from jameskoster/header.php
WooCommerce - Update number of items in cart and total after Ajax
<?php
// Ensure cart contents update when products are added to the cart via AJAX (place the following in functions.php)
add_filter( 'woocommerce_add_to_cart_fragments', 'woocommerce_header_add_to_cart_fragment' );
function woocommerce_header_add_to_cart_fragment( $fragments ) {
ob_start();
?>
<a class="cart-contents" href="<?php echo wc_get_cart_url(); ?>" title="<?php _e( 'View your shopping cart' ); ?>"><?php echo sprintf (_n( '%d item', '%d items', WC()->cart->get_cart_contents_count() ), WC()->cart->get_cart_contents_count() ); ?> - <?php echo WC()->cart->get_cart_total(); ?></a>
<?php
@gregrickaby
gregrickaby / remove-woocommerce-styles-scripts.php
Last active April 25, 2024 09:45
Remove WooCommerce styles and scripts.
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below into functions.php
/**
* Manage WooCommerce styles and scripts.
*/
function grd_woocommerce_script_cleaner() {
// Remove the generator tag
remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) );
@habibmac
habibmac / gist:2883102
Created June 6, 2012 16:33
WP: Wordpress profiling tools
if ( !defined('SAVEQUERIES') && isset($_GET['debug']) && $_GET['debug'] == 'sql' )
define('SAVEQUERIES', true);
if ( !function_exists('dump') ) :
/**
* dump()
*
* @param mixed $in
* @return mixed $in
**/
@thefuxia
thefuxia / t5-fresh-editor-stylesheets.php
Created July 21, 2012 06:46
T5 Fresh Editor Stylesheets
<?php # -*- coding: utf-8 -*-
/**
* Plugin Name: T5 Fresh Editor Stylesheets
* Description: Enforces fresh editor stylesheets per version parameter.
* Version: 2012.08.09
* Author: Thomas Scholz
* Plugin URI: http://toscho.de/?p=1965
* Author URI: http://toscho.de
* License: MIT
* License URI: http://www.opensource.org/licenses/mit-license.php
@samu1241
samu1241 / websymbols.css
Created September 20, 2012 07:07
CSS: WebSymbols Font
/**
* Stylesheet that implements WebSymbols font
* http://www.justbenicestudio.com/studio/websymbols/
*
* Autor Yordan Ivanov
* yordan.t.ivanov@gmail.com
*/
@font-face{
font-family: 'WebSymbolsRegular';
@DevinVinson
DevinVinson / cart-on-checkout
Created March 31, 2013 15:32
Add the woocommerce cart on top of the checkout page.
// Add Cart to Checkout //
add_action( 'woocommerce_before_checkout_form', 'lk_show_cart', 5 );
function lk_show_cart()
{
global $woocommerce;
?>
<form action="<?php echo esc_url( $woocommerce->cart->get_cart_url() ); ?>" method="post">