Skip to content

Instantly share code, notes, and snippets.

View claudiosanches's full-sized avatar
👨‍💻

Claudio Sanches claudiosanches

👨‍💻
View GitHub Profile
@claudiosanches
claudiosanches / functions.php
Created December 5, 2012 23:51
WordPress - Thumbnails
<?php
// Adiciona suporte para os thumbnails
add_theme_support( 'post-thumbnails' );
// Adiciona os tamanhos que vai usar
// No exemplo ela chama 'thumb_home' e tem largura e altura iguais a 150px e faz crop
add_image_size( 'thumb_home', 150, 150, true );
// Mais exemplos de como adicionar os tamanhos:
@claudiosanches
claudiosanches / edd-bitcoin-currency.php
Created December 9, 2012 04:51
Easy Digital Downloads Bitcoin Currency
<?php
/**
* Plugin Name: Easy Digital Downloads BTC Currency
* Plugin URI: http://claudiosmweb.com/
* Description: Adds Bitcoin currency in Easy Digital Downloads
* Author: claudiosanches
* Author URI: http://claudiosmweb.com/
* Version: 1.0
* License: GPLv2 or later
* Text Domain: eddbitcc
@claudiosanches
claudiosanches / functions.php
Last active October 13, 2015 21:38
WooCommerce - Add new tab in products
<?php
// WooCommerce Hooks.
add_action( 'woocommerce_product_tabs', 'cs_add_product_tab' );
add_action( 'cs_display_product_tab', 'cs_display_product_tab' );
/**
* Add the new tab.
*/
function cs_add_product_tab( $tabs ) {
$tabs['nome_da_tab'] = array(
@claudiosanches
claudiosanches / pagina.html
Created December 12, 2012 23:41
Exemplo de blocos do Adsense flutuando lado a lado.
<div style="float: left;">
<!-- Primeiro código do Adsense aqui -->
</div>
<div style="float: left; margin: 0 20px;">
<!-- Segundo código do Adsense aqui -->
</div>
<div style="float: left;">
<!-- Terceiro código do Adsense aqui -->
@claudiosanches
claudiosanches / functions.php
Created December 17, 2012 22:52
Jigoshop Correios - Definir um pacote padrão.
<?php
/**
* Pacote padrão.
*
* @param array $measures Medidas antigas.
*
* @return array Novo array com as medidas padrões.
*/
function custom_default_package( $measures ) {
@claudiosanches
claudiosanches / price.php
Created December 18, 2012 23:19
WooCommerce - Ocultar o preço para produtos com variáveis.
<?php
/**
* Single Product Price, including microdata for SEO
*
* @author WooThemes
* @package WooCommerce/Templates
* @version 1.6.4
*/
global $post, $product;
@claudiosanches
claudiosanches / functions.php
Created December 19, 2012 00:39
WooCommerce - Show empty product categories.
<?php
/**
* WooCommerce - Show empty product categories.
*
* @param array $args Default widget argument.
*
* @return array New arguments with hide_empty.
*/
function wc_show_empty_categories( $args ) {
$args['hide_empty'] = 0;
@claudiosanches
claudiosanches / index.php
Created December 22, 2012 03:27
Para o Gabriel de Brito.
<?php
/**
* Front to the WordPress application. This file doesn't do anything, but loads
* wp-blog-header.php which does and tells WordPress to load the theme.
*
* @package WordPress
*/
/**
* Tells WordPress to load the WordPress theme and output it.
@claudiosanches
claudiosanches / .htaccess
Created December 22, 2012 03:44
Para o Gabriel de Brito também.
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www.)?metalfuckers.com.br$
RewriteRule ^(/)?$ site [L]
@claudiosanches
claudiosanches / style.css
Created December 22, 2012 15:13
Remove WordPress.com Stats smiley :)
/* Remove WP.com Stats smiley :) */
img#wpstats {
display: none;
}