sudo nano npm install gulp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Applicare uno sconto nel carrello, se siamo el range di 2 date | |
* (giorno settato compreso) | |
*/ | |
function applica_sconto_per_range_di_date( $cart ) { | |
// Se siamo in admin e non è una chiamata AJAX | |
if ( ( is_admin() && ! defined( 'DOING_AJAX' ) ) ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// FIX WooCommerce orders list bug | |
function fix_query_args_woo_orders( $query_args ) { | |
if ( isset( $query_args['post_status'] ) && | |
empty( $query_args['post_status'] ) ) { | |
unset( $query_args['post_status'] ); | |
} | |
return $query_args; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@font-face { | |
font-family: 'Roboto'; | |
src: url('Roboto-Bold.eot'); | |
src: url('Roboto-Bold.eot?#iefix') format('embedded-opentype'), | |
url('Roboto-Bold.woff') format('woff'), | |
url('Roboto-Bold.ttf') format('truetype'); | |
font-weight: bold; | |
font-style: normal; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function live_search_scripts() { | |
wp_register_script( 'live-search', get_template_directory_uri() . '/scripts.js', array('jquery'), null, true ); | |
wp_enqueue_script( 'live-search' ); | |
$live_search = [ | |
'ajax_url' => admin_url('admin-ajax.php') | |
]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Live Search */ | |
.live-search-modal { | |
position: fixed; | |
z-index: 998; | |
top: 0; | |
left: 0; | |
right: 0; | |
bottom: 0; | |
width: 100%; | |
height: 100%; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( function( $ ) { | |
$(document).ready(function (){ | |
// Live Search | |
$('#live-search-faux-input').on('click', function() { | |
$('.live-search-modal').fadeIn(500); | |
$('input#live-search-input').focus(); | |
$('#live-search-input').addClass('live-search-to-show'); | |
}); | |
$('input#live-search-input').on('input', function() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Live search | |
*/ | |
function live_search(){ | |
$the_query = new WP_Query( [ | |
'post_type' => ['posts'], | |
'posts_per_page' => -1, | |
's' => esc_attr($_POST['keyword']) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* YourTheme | |
* | |
* @package YourTheme | |
* | |
* To include that file: get_template_part('live','search'); | |
*/ | |
?> | |
<div id="live-search-faux-input"><input type="text" placeholder="<?php _e('Search...','yourtheme') ?>"></div> |
npm install gulp