Skip to content

Instantly share code, notes, and snippets.

View davidperezgar's full-sized avatar

David Perez davidperezgar

View GitHub Profile
<?php
/**
* Display how many spots are left in the choice label when using the GP Limit Choices perk
* http://gravitywiz.com/gravity-perks/
*/
add_filter( 'gplc_remove_choices', '__return_false' );
add_filter( 'gplc_pre_render_choice', 'my_add_how_many_left_message', 10, 4 );
/**
* Register new status
* Tutorial: http://www.sellwithwp.com/woocommerce-custom-order-status-2/
**/
function register_awaiting_shipment_order_status() {
register_post_status( 'wc-awaiting-shipment', array(
'label' => 'Awaiting shipment',
'public' => true,
'exclude_from_search' => false,
'show_in_admin_all_list' => true,
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.mysite.com/$1 [R,L]
</IfModule>
@davidperezgar
davidperezgar / functions.php
Last active August 29, 2015 14:14 — forked from BFTrick/functions.php
Wp Dequeue Styles and Scripts in functions child theme
//dequeue css from plugins
add_action('wp_print_styles', 'mytheme_dequeue_css_from_plugins', 100);
function mytheme_dequeue_css_from_plugins() {
wp_dequeue_style( '' );
}
add_action('wp_print_scripts','mytheme_dequeue_js_from_plugins');
function mytheme_dequeue_js_from_plugins() {
wp_dequeue_script( '' );
}
/**
* Register new status
* Tutorial: http://www.sellwithwp.com/woocommerce-custom-order-status-2/
**/
function register_awaiting_shipment_order_status() {
register_post_status( 'wc-awaiting-shipment', array(
'label' => 'Awaiting shipment',
'public' => true,
'exclude_from_search' => false,
'show_in_admin_all_list' => true,
@davidperezgar
davidperezgar / wordpress-font-awesome-ie7-cdn.php
Created November 16, 2015 23:33 — forked from robneu/wordpress-font-awesome-ie7-cdn.php
Add Font Awesome With IE7 Support to WordPress using a CDN
<?php
/**
* Registers and loads font awesome
* CSS files using a CDN.
*
* @link http://www.bootstrapcdn.com/#tab_fontawesome
* @author FAT Media
*/
add_action( 'wp_enqueue_scripts', 'prefix_enqueue_awesome' );
/**
@davidperezgar
davidperezgar / gist:6bb9d7f18b1ace430dbc
Created December 3, 2015 13:03 — forked from billerickson/gist:1493758
Gallery metabox - custom post types
<?php
/**
* Gallery Metabox - Only show on 'page' and 'rotator' post types
* @author Bill Erickson
* @link http://www.wordpress.org/extend/plugins/gallery-metabox
* @link http://www.billerickson.net/code/gallery-metabox-custom-post-types
* @since 1.0
*
* @param array $post_types
@davidperezgar
davidperezgar / quantity-input.php
Last active May 3, 2016 10:45 — forked from chrisvanpatten/functions.php
Quantity Select in Woocommerce in theme/woocommerce/global
<?php
/**
* Product quantity inputs
*
* @author WooThemes
* @package WooCommerce/Templates
* @version 2.5.0
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@davidperezgar
davidperezgar / functions.php
Created July 6, 2016 08:41 — forked from WPprodigy/functions.php
Remove the password strength meter from WooCommerce checkout
function wc_ninja_remove_password_strength() {
if ( wp_script_is( 'wc-password-strength-meter', 'enqueued' ) ) {
wp_dequeue_script( 'wc-password-strength-meter' );
}
}
add_action( 'wp_print_scripts', 'wc_ninja_remove_password_strength', 100 );
@davidperezgar
davidperezgar / functions.php
Created July 23, 2016 07:27
Remove the entry meta in the entry header with the Genesis Framework.
<?php
//* Do NOT include the opening php tag
//* Remove the entry meta in the entry header
remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_open', 5 );
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_close', 15 );