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
<style type="text/css" media="screen"> | |
html { margin-top: 32px !important; } | |
* html body { margin-top: 32px !important; } | |
@media screen and ( max-width: 782px ) { | |
html { margin-top: 46px !important; } | |
* html body { margin-top: 46px !important; } | |
} | |
</style> |
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 | |
//Remove (Free) label on cart page for "Shipping and Handling" if cost is $0 | |
function sv_change_cart_shipping_free_label( $label ) { | |
$label = str_replace( "(Free)", " ", $label ); | |
return $label; | |
} | |
add_filter( 'woocommerce_cart_shipping_method_full_label' , 'sv_change_cart_shipping_free_label' ); |
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 | |
//add shortoce gist to wordpress | |
//Use [gist id="" file=""] | |
/* | |
EX: https://gist.github.com/fae35ed5bf667d968a68#file-shortcode-gist-php | |
=> shortcode: [gist id="fae35ed5bf667d968a68" file="ShortCode-Gist.php"] | |
*/ | |
function gist_func( $atts ){ | |
$atts = shortcode_atts( array( |
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_value max_input_vars 7000 | |
into my .htaccess file and all works now. |
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 | |
add_action( 'wp_enqueue_scripts', 'enqueue_my_styles' ); | |
function enqueue_my_styles() { | |
global $wp_styles; | |
// Load the main stylesheet | |
wp_enqueue_style( 'my-theme', get_stylesheet_uri() ); | |
/** |
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
<div class="text">123456</div> | |
<style> | |
span{ | |
color: red; | |
} | |
</style> | |
<script> | |
$('.text').each(function(){ | |
var text = $(this).html().split(''), | |
len = text.length, |
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 | |
/* | |
* Add to functions.php | |
* Add div.videoWrapper to iframe | |
*/ | |
function div_wrapper($content) { | |
// match any iframes | |
/*$pattern = '~<iframe.*</iframe>|<embed.*</embed>~'; // Add it if all iframe*/ | |
$pattern = '~<iframe.*src=".*(youtube.com|youtu.be).*</iframe>|<embed.*</embed>~'; //only iframe youtube | |
preg_match_all($pattern, $content, $matches); |
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 | |
$arg = array( | |
'post_type' => 'events',//thay bằng post type của bạn | |
'posts_per_page' => 3, | |
'orderby' => 'meta_value', | |
'meta_key' => 'start_date_event',//thay bằng meta key của bạn | |
'order' => 'ASC', | |
'meta_query' => array( | |
array( | |
'key' => 'start_date_event',//thay bằng meta key của bạn |
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
$(window).scroll(function(){ | |
var window_top = $(window).scrollTop(); | |
var div_top = $(".number_counter").offset().top + 50; // Change class .number_counter | |
var window_height = $(window).height(); | |
if (window_top + window_height >= div_top) { | |
//Code here | |
} | |
}); |
OlderNewer