Skip to content

Instantly share code, notes, and snippets.

View bluvertigo's full-sized avatar

Andrea Gentili bluvertigo

View GitHub Profile
@bluvertigo
bluvertigo / functions.php
Created December 16, 2014 11:45
RImuovere conteggio prodotti nelle categorie / How to Remove WooCommerce Category Product Count
/*
* Removes products count after categories name
*/
add_filter( 'woocommerce_subcategory_count_html', 'woo_remove_category_products_count' );
function woo_remove_category_products_count() {
return;
}
@bluvertigo
bluvertigo / content.md
Last active March 15, 2018 13:49
Dicitura campi obbligatorio form / required field
ENG ITA
All fields marked with an asterisk (*) are required Tutti i campi segnati con un asterisco (*) sono obbligatori
@bluvertigo
bluvertigo / content.html
Last active September 29, 2017 09:45
Font Awsome nelle liste ul li / Font Awesome in an unordered list
<ul>
<li>Lorem ipsum deserunt consequat fugiat tempor. Lorem ipsum deserunt consequat fugiat tempor. Lorem ipsum deserunt consequat fugiat tempor. Lorem ipsum deserunt consequat fugiat tempor. Lorem ipsum deserunt consequat fugiat tempor. Lorem ipsum deserunt consequat fugiat tempor. Lorem ipsum deserunt consequat fugiat tempor. Lorem ipsum deserunt consequat fugiat tempor. Lorem ipsum deserunt consequat fugiat tempor. Lorem ipsum deserunt consequat fugiat tempor. Lorem ipsum deserunt consequat fugiat tempor.</li>
<li>List Item</li>
<li>List Item</li>
</ul>
@bluvertigo
bluvertigo / functions.php
Last active September 29, 2017 09:45
Includere script css e js / include script file
/**
* Add Script to jQuery
*/
// css/js
function function_add_script() {
wp_enqueue_script( 'nome_01', get_stylesheet_directory_uri().'/PERCORSO.js', array('jquery'), null, true );
wp_enqueue_script( 'nome_02', get_stylesheet_directory_uri().'ATTIVA_SCRIPT.js', array('nome_01'), null, true );
wp_enqueue_style( 'nome_02', get_stylesheet_directory_uri().'PERCORSO.css');
}
@bluvertigo
bluvertigo / shadow.svg
Last active September 29, 2017 09:45
Effetto SVG - Aggiungere sfondo al testo sopra ad un immagine / Add text background like flickr
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bluvertigo
bluvertigo / functions.php
Created February 13, 2015 16:13
Disabilitare autop e autobr / disable autop <p> <br/>
add_action( 'pre_get_posts', 'mfields_remove_autop_from_posts' );
function mfields_remove_autop_from_posts() {
if( is_page(3970) )
remove_filter( 'the_content', 'wpautop' );
}
@bluvertigo
bluvertigo / index.php
Last active September 29, 2017 09:45
Facebook Connect graph api - Acces Token -> http://goo.gl/TGkg55
<?php
session_start();
// added in v4.0.0
require_once 'facebook-php-sdk/autoload.php';
use Facebook\FacebookSession;
use Facebook\FacebookRedirectLoginHelper;
use Facebook\FacebookRequest;
use Facebook\FacebookResponse;
use Facebook\FacebookSDKException;
@bluvertigo
bluvertigo / funcions-alternativa.php
Last active September 29, 2017 09:44
Changing the number of product columns / Numero colonne prodotti
<?php
/* Alternativa che varia in base alla pagina*/
add_filter('loop_shop_columns', 'loop_columns');
if (!function_exists('loop_columns')); {
function loop_columns() {
if (is_shop()){
return 2; // 2 products per row
}elseif(is_product_category()){
return 4; // 4 products per row
@bluvertigo
bluvertigo / template.php
Last active September 29, 2017 09:44
Template json - Wordpress post
<?php
/*
* Template name: json
*/
// include our wordpress functions
// change relative path to find your WP dir
define('WP_USE_THEMES', false);
@bluvertigo
bluvertigo / post.php
Created February 24, 2015 15:06
Questa funzione riduce il testo ad un certo numero di parole e restituisce il testo ridotto.
<?php
$content = get_the_content();
$trimmed_content = wp_trim_words( $content, 40, '<a href="'. get_permalink() .'"> ...Leggi altro</a>' );
echo $trimmed_content;
?>