Skip to content

Instantly share code, notes, and snippets.

View espellcaste's full-sized avatar

Renato Alves espellcaste

View GitHub Profile
@espellcaste
espellcaste / gist:5478731
Last active December 16, 2015 18:38
Creating extra profile info in the members profile header with this function. Change field= to the field you want to display.
function extra_profile_fields_output(){
global $bp;
$field_text = bp_get_profile_field_data( 'field=Country' ) );
echo '<span class="profile-fields">' .$field_text. '</span>';
}
add_action( 'bp_profile_header_meta', 'extra_profile_fields_output' );
@espellcaste
espellcaste / impressão-landscape
Last active December 18, 2015 12:19
Imprimir a página em modo landscape.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Imnpress&atilde;o</title>
<style>
@media print{
#print{
width: 100%;
height: 100%;
margin: 0% 0% 0% 0%;
<?php
/**
* Plugin Name: WooCommerce Installments
* Plugin URI: http://claudiosmweb.com/
* Description: Added the price with 3 installments without interest.
* Author: claudiosanches
* Author URI: http://www.claudiosmweb.com/
* Version: 1.0
* License: GPLv2 or later
*/
/* The Grid ---------------------- */
.lt-ie9 .row { width: 940px; max-width: 100%; min-width: 768px; margin: 0 auto; }
.lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; }
.lt-ie9 .row.large-collapse .column,
.lt-ie9 .row.large-collapse .columns { padding: 0; }
.lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; }
.lt-ie9 .row .row.large-collapse { margin: 0; }
.lt-ie9 .column, .lt-ie9 .columns { float: left; min-height: 1px; padding: 0 15px; position: relative; }
.lt-ie9 .column.large-centered, .columns.large-centered { float: none; margin: 0 auto; }
@espellcaste
espellcaste / functions.php
Last active December 19, 2015 09:09 — forked from claudiosanches/functions.php
WooCommerce - Não permitir usuário comprar o mesmo produto mais de uma vez.
<?php
function cs_woocommere_buy_once() {
global $woocommerce;
if ( is_checkout() ) {
if ( ! is_user_logged_in() ) {
$woocommerce->add_error(
sprintf(
__( 'Desculpe, mas você deve estar logado para finalizar esta compra. <a href="%s">Fazer login &rarr;</a>', 'woocommerce'),
get_permalink( woocommerce_get_page_id( 'myaccount' ) )
<?php
/*
* Plugin Name: wpMandrill MS
* Plugin URI: trepmal.com
* Description: Network-wide settings for wpMandrill.
* Version: 2013.04.01
* Author: Kailey Lampert
* Author URI: kaileylampert.com
* License: GPLv2 or later
* TextDomain: wpmandrill-ms
<?php
/**
* Plugin Name: WooCommerce Correios - Envelope
* Plugin URI: http://claudiosmweb.com/
* Description: Este plugin ajuda a usar uma taxa fixa para ser usada como preço de envelope
* Author: claudiosanches
* Author URI: http://claudiosmweb.com/
* Version: 1.0
* License: GPLv2 or later
*/
<?php
/**
* Plugin Name: WooCommerce Correios - Envelope
* Plugin URI: http://claudiosmweb.com/
* Description: Este plugin ajuda a usar uma taxa fixa para ser usada como preço de envelope
* Author: claudiosanches
* Author URI: http://claudiosmweb.com/
* Version: 1.0
* License: GPLv2 or later
*/
<?php
/*
* Plugin Name: Category Image Field
* Plugin URI: http://claudiosmweb.com/
* Description: Adds image field in category description.
* Version: 0.1
* Author: Claudio Sanches
* Author URI: http://claudiosmweb.com/
* License: GPLv2 or later
*/