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
add_action('woocommerce_checkout_process', 'create_vip_order'); | |
function create_vip_order() { | |
global $woocommerce; | |
$address = array( | |
'first_name' => 'Tien Dung', | |
'last_name' => 'Dao', | |
'company' => 'TTV', |
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 vts_shortcode_box(){ | |
ob_start(); | |
?> | |
<div class="box">Content blabla</div> | |
<?php | |
$result = ob_get_contents(); | |
ob_end_clean(); | |
return $result; | |
} |
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
/*404*/ | |
.error-404{padding:0; margin:0} | |
.error-404 .medium-3 { | |
max-width: 100%; | |
-ms-flex-preferred-size: 100%; | |
flex-basis: 100%; | |
text-align: center; | |
font-size: 45px!important; | |
padding: 0; | |
margin: 0 |
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 | |
/** | |
* Enforce strong passwords (ESP) for all website users. | |
* | |
* To disable enforcing strong passwords: | |
* define('ESP_IS_ENABLED', false); | |
*/ | |
if (!defined('WPINC')) { | |
exit('Do NOT access this file directly.'); |
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 if(is_paged()){ echo '<meta name="robots" content="follow, noindex"/>'; } ?> | |
<?php | |
//check url neu co tu page thi cho noindex | |
$url = 'https://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; | |
if (strpos($url,'page') !== false) { | |
echo '<meta name="robots" content="follow, noindex"/>'; | |
} | |
?> |
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
function preload_featured_image(){ | |
if (has_post_thumbnail()) { | |
$attachment_image = wp_get_attachment_url( get_post_thumbnail_id() ); | |
echo '<link rel="preload" as="image" href="'.$attachment_image.'">'; | |
} | |
} | |
add_action('wp_head', 'preload_featured_image'); |
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
// WordPress Breadcrumb Function | |
function vts_breadcrumb() { | |
// Check if is front/home page, return | |
if ( is_front_page() ) { | |
return; | |
} | |
// Define | |
global $post; |
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
/** | |
* Multi excerpt_length | |
*/ | |
function vts_variable_excerpt_length( $length ) { | |
global $post; | |
if ( 'post' === $post->post_type ) { | |
return 32; | |
} else if ( 'page' === $post->post_type ) { | |
return 65; |
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 | |
$args = array( | |
'post_type' => 'page', //write slug of post type | |
'posts_per_page' => -1, | |
'post_parent' => '26', //place here id of your parent page | |
'order' => 'ASC', | |
'orderby' => 'menu_order' | |
); | |
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
add_action( 'widgets_init', 'vts_remove_default_widgets' ); | |
function vts_remove_default_widgets() { | |
unregister_widget( 'WP_Widget_Pages' ); | |
unregister_widget( 'WP_Widget_Calendar' ); | |
unregister_widget( 'WP_Widget_Archives' ); | |
unregister_widget( 'WP_Widget_Links' ); | |
unregister_widget( 'WP_Widget_Media_Audio' ); | |
unregister_widget( 'WP_Widget_Media_Image' ); | |
unregister_widget( 'WP_Widget_Media_Video' ); | |
unregister_widget( 'WP_Widget_Media_Gallery' ); |
NewerOlder