Skip to content

Instantly share code, notes, and snippets.

View claudiosanches's full-sized avatar
👨‍💻

Claudio Sanches claudiosanches

👨‍💻
View GitHub Profile
<?php
function cs_wc_loop_add_to_cart_scripts() {
if ( is_shop() || is_product_category() || is_product_tag() || is_product() ) : ?>
<script>
jQuery(document).ready(function($) {
$(document).on( 'change', '.quantity .qty', function() {
$(this).parent('.quantity').next('.add_to_cart_button').attr('data-quantity', $(this).val());
});
});
<?php
/*
Template Name: Print Processing Orders :)
*/
if (!is_user_logged_in() || !current_user_can('manage_options')) wp_die('This page is private.');
?>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
@claudiosanches
claudiosanches / content.php
Last active December 15, 2015 09:59
Odin com resumos e redes sociais
<article <?php post_class(); ?>>
<header class="entry-header">
<h2 class="entry-title">
<a href="<?php the_permalink(); ?>" title="<?php echo __( 'Link Permanente para ', 'odin' ) . get_the_title(); ?>" rel="bookmark"><?php the_title(); ?></a>
</h2>
<div class="entry-meta">
<span class="sep"><?php _e( 'Por ', 'odin' ); ?></span>
<span class="author vcard">
<a class="url fn n" href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" title="<?php echo esc_attr( __( 'Ver todos os posts de ', 'odin') . get_the_author() ); ?>" rel="author"><?php echo get_the_author(); ?></a>
</span>
@claudiosanches
claudiosanches / functions.php
Created April 3, 2013 21:28
WordPress - Custom comment_form fields
<?php
/**
* Custom comment_form fields
*
* @param array $fields Default form fields
*
* @return array New Form fields
*/
function custom_comment_form_field( $fields ) {
@claudiosanches
claudiosanches / index.php
Created April 5, 2013 04:32
WooCommerce - Produtos em Destaque
<h2><?php _e( 'Produtos em Destaque', 'odin' ); ?></h2>
<?php
global $woocommerce;
$query_args = array(
'posts_per_page' => 5,
'no_found_rows' => 1,
'post_status' => 'publish',
'post_type' => 'product'
);
$query_args['meta_query'] = array();
@claudiosanches
claudiosanches / wc-correios-only-sedex-addon.php
Created April 14, 2013 06:37
WooCommerce Correios - Only Sedex Add-on
<?php
/**
* Plugin Name: WooCommerce Correios - Only Sedex Add-on
* Plugin URI: http://claudiosmweb.com/
* Description: Este plugins serve para indicar que certos produtos não podem ser entregues por PAC
* Author: claudiosanches
* Author URI: http://claudiosmweb.com/
* Version: 1.0
* License: GPLv2 or later
*/
@claudiosanches
claudiosanches / functions.php
Created April 20, 2013 02:16
Custom Social Count Plus Number Format
<?php
/**
* Custom Social Count Plus Number Format.
*
* @param int $number Default number.
*
* @return float New formated number.
*/
function custom_social_count_plus_number_format( $number ) {
@claudiosanches
claudiosanches / fix-boleto.php
Last active December 16, 2015 10:59
Fix WooCommerce Boleto ID with WooCommerce Sequential Order Numbers
<?php
/**
* Plugin Name: Fix WooCommerce Boleto ID with WooCommerce Sequential Order Numbers
* Plugin URI: http://claudiosmweb.com/
* Description: WooCommerce Boleto is a brazilian payment gateway for WooCommerce
* Author: claudiosanches
* Author URI: http://claudiosmweb.com/
* Version: 0.1
* License: GPLv2 or later
*/
@mixin linear-gradient($angle, $color-stops...) {
$_angle-with-vendor-prefix: "";
$_angle: "";
@if $angle == "to top" or $angle == "bottom" {
$_angle-with-vendor-prefix: bottom;
$_angle: to top;
} @else if $angle == "to right" or $angle == "left" {
$_angle-with-vendor-prefix: left;
$_angle: to right;
} @else if $angle == "to bottom" or $angle == "top" {
@claudiosanches
claudiosanches / .htaccess
Last active December 16, 2015 20:59
Custom php.ini
suPHP_ConfigPath /home/user/public_html
<Files php.ini>
order allow,deny
deny from all
</Files>