This file contains 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 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 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 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 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 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 | |
} | |
}); |
This file contains 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 | |
*/ | |
function comment_validation_init() { | |
if(is_singular() && comments_open() ) { ?> | |
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.13.1/jquery.validate.min.js"></script> | |
<script type="text/javascript"> | |
jQuery(document).ready(function($) { | |
$('#commentform').validate({ |
This file contains 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 my_page_template_redirect(){ | |
global $post; | |
if( is_a( $post, 'WP_Post' ) && has_shortcode( $post->post_content, 'your_short_code') && ! is_user_logged_in() ) { | |
wp_redirect(URL_IN_HERE); | |
exit(); | |
} | |
} | |
add_action( 'template_redirect', 'my_page_template_redirect' ); |
This file contains 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
/*Nếu khi click vào thẻ a bật fancybox mà bị nhảy lên đầu trang thì bạn thêm đoạn script này vào là ok*/ | |
helpers: { | |
overlay: { | |
locked: false | |
} | |
} | |
Ví dụ thực tế: |
OlderNewer