Skip to content

Instantly share code, notes, and snippets.

View eder-dias's full-sized avatar

Eder Dias eder-dias

  • Brasil - São Paulo
View GitHub Profile
@eder-dias
eder-dias / 0_reuse_code.js
Created May 21, 2017 00:09
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@eder-dias
eder-dias / .htaccess
Created May 21, 2017 00:13
Disable Pingbacks and Trackbacks [Wordpress]
# START XML RPC BLOCKING
<Files xmlrpc.php>
Order Deny,Allow
Deny from all
</Files>
# FINISH XML RPC BLOCKING
@eder-dias
eder-dias / functions.php
Created May 21, 2017 00:15
Remove query strings from static resources.
// Add this code to your theme’s functions.php
function ewp_remove_script_version( $src ) {
return remove_query_arg( 'ver', $src );
}
add_filter( 'script_loader_src', 'ewp_remove_script_version', 15, 1 );
add_filter( 'style_loader_src', 'ewp_remove_script_version', 15, 1 );
@eder-dias
eder-dias / functions.php
Created May 21, 2017 00:18
Increase images in admin Woocommerce orders
//aumentar as imagens nos pedidos do woocommerce
add_action('admin_head', 'my_custom_fonts');
function my_custom_fonts() {
echo '<style>
#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items td.thumb .wc-order-item-thumbnail{width:150px!important; height:150px!important}
#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items tbody#order_line_items tr:first-child td{color:#000!important;font-weight:bold!important}
#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items .quantity .view{color:#0099d5!important;background:#e5f5fb!important;}
</style>';
}
@eder-dias
eder-dias / styles.css
Last active August 3, 2017 21:45 — forked from ahmedeshaan/Product Button Align
Product Button Align
.woocommerce ul.products li.product, .woocommerce-page ul.products li.product {min-height: 500px !important; margin-bottom:10px; }
ul.products li.product a.button {position: absolute !important; bottom: 500px; }
.box-text {
min-height: 145px;
position: relative;
}
.add-to-cart-button {
position: absolute;
top: 90px;
@eder-dias
eder-dias / .htaccess
Created August 3, 2017 21:43
Redirect from non-www to www and HTTP to https.
RewriteEngine on
RewriteCond %{HTTP_HOST} ^yoururl.com [NC]
RewriteRule ^(.*)$ http://www.yoururl.com/$1 [L,R=301,NC]
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
@eder-dias
eder-dias / functions.php
Created August 21, 2017 02:47
Change Sender Name in Outgoing WordPress Email
// Function to change email address
function wpb_sender_email( $original_email_address ) {
return '[email protected]';
}
// Function to change sender name
function wpb_sender_name( $original_email_from ) {
return 'YOUR NAME';
}
@eder-dias
eder-dias / functions.php
Last active November 3, 2017 05:16
Adicionar campo checkout
//Adicionar campo no checkout e nova coluna no painel admin
/*Add the field to the checkout*/
add_action('woocommerce_before_order_notes', 'my_custom_checkout_field');
function my_custom_checkout_field( $checkout ) {
echo '<div id="my_custom_checkout_field"><h3>'.__('Como nos conheceu?').'</h3>';
woocommerce_form_field( 'my_field_name', array(
@eder-dias
eder-dias / functions.php
Created November 3, 2017 05:10
Remover tabs na pag do produto - Woocommerce
//Remove as tabs da pag do produto
add_filter( 'woocommerce_product_tabs', 'woo_remove_product_tabs', 98 );
function woo_remove_product_tabs( $tabs ) {
unset( $tabs['reviews'] ); // Remove the reviews tab
unset( $tabs['additional_information'] ); // Remove the additional information tab
return $tabs;
}
@eder-dias
eder-dias / functions.php
Created November 3, 2017 05:12
Personalizar imagens e fontes nos pedidos - Woocommerce
//personalizar as imagens e fontes nos pedidos do woocommerce
add_action('admin_head', 'my_custom_fonts');
function my_custom_fonts() {
echo '<style>
#woocommerce-order-items .woocommerce_order_items_wrapper table.woocommerce_order_items td.thumb .wc-order-item-thumbnail{width:150px!important; height:150px!important}
</style>';
}