Skip to content

Instantly share code, notes, and snippets.

View mrfoxtalbot's full-sized avatar
🕊️

Alvaro Gómez Velasco mrfoxtalbot

🕊️
View GitHub Profile
$space-inset-default = 16px 16px 16px 16px;
$space-inset-xs = 4px 4px 4px 4px;
$space-inset-s = 8px 8px 8px 8px;
$space-inset-m = 16px 16px 16px 16px;
$space-inset-l = 32px 32px 32px 32px;
$space-inset-xl = 64px 64px 64px 64px;
$space-stack-default = 0 0 16px 0;
$space-stack-xs = 0 0 4px 0;
$space-stack-s = 0 0 8px 0;
$space-stack-m = 0 0 16px 0;
@maugelves
maugelves / get-fisrt-paragraph.php
Last active October 28, 2016 19:15 — forked from banago/get-fisrt-paragraph.php
Get first paragraph from a WordPress post.
<?php
/**
* Get first paragraph from a WordPress post. Use inside the Loop.
*
* @param $class string optional class name to include in the paragraph
* @return string
*/
function get_first_paragraph( $class = '' ){
global $post;
@maugelves
maugelves / get-last-children-taxonomies-for-post.php
Last active October 28, 2016 19:14
Get the latest child category/ies (those who aren't parent) for a specific post
<?php
/**
* Get the latest hierarchical taxonomy children of a post
*
* @author Mauricio Gelves <yo@maugelves.com>
* @param $post_id int Post ID
* @return array
*/
function get_last_children_taxonomy_in_post( $post_id, $taxonomy = 'category'){
@kontikidigital
kontikidigital / htaccess-redsys
Last active October 14, 2018 15:44
WooCommerce: Error Redsys con SSL
#Al tener un SSL con SNI o Let's Encrypt, redsys no devuelve bien el estado del pedido pago y lo deja "En Espera"
#Esto se produce porque redsys no es compatible con estos protocolos, por lo tanto hay que saltear el https: en la
#respuesta de redsys. La solución es en el plugin (https://wordpress.org/plugins/woocommerce-sermepa-payment-gateway/)
#elegir el Protocolo para notificaciones HTTP y en el .htacces añadir una exclusión a la regla que redirige de
#HTTP a HTTPS.
# Enviar trafico HTTP a HTTPS
RewriteEngine On
# Si la cadena de consulta no contiene wc-api=WC_MyRedsys
RewriteCond %{QUERY_STRING} !wc-api=WC_MyRedsys [NC]
<?php
/*
Plugin Name: Lightweght Share para Tu Experto
Description: Botones de compartir ligeritos y sin javascript.
Version: 0.1
Author: Mr.FoxTalbot
Author URI: http://mrfoxtalbot.com
License: GPL2
*/
@stuartduff
stuartduff / wc-exclude-product-category-from-shop-page.php
Last active May 6, 2022 00:20
This snippet will exclude all products from any categories which you choose from displaying on the WooCommerce Shop page.
function custom_pre_get_posts_query( $q ) {
$tax_query = (array) $q->get( 'tax_query' );
$tax_query[] = array(
'taxonomy' => 'product_cat',
'field' => 'slug',
'terms' => array( 'clothing' ), // Don't display products in the clothing category on the shop page.
'operator' => 'NOT IN'
);