Server IP : 172.67.158.161 / Your IP : 18.117.107.120 Web Server : LiteSpeed System : Linux business53.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : giankuin ( 1871) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/giankuin/thietke365.net/wp-content/themes/flatsome-child/ |
Upload File : |
<?php add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' ); function custom_override_checkout_fields( $fields ) { unset($fields['billing']['billing_postcode']); unset($fields['billing']['billing_country']); unset($fields['billing']['billing_address_2']); unset($fields['billing']['billing_company']); unset($fields['billing']['billing_city']); unset($fields['billing']['billing_last_name']); return $fields; } add_action( 'woocommerce_single_product_summary', 'show_link', 7 ); function show_link(){ $field1=get_field('link_web'); if(strlen(strstr($field1 , "http")) > 0){ $linkchuan=$field1; }else{ $linkchuan="http://".$field1; } ?> <div class="dang-ky"> <a href="<?php echo $linkchuan?>/?id=7" target="_blank" class="icon button circle is-normal" title="Click here" id="tao" style="padding:0px 30px">Xem trang web thực tế</a> </div> <?php } add_action('flatsome_product_box_actions','link_xem'); function link_xem(){ $field1=get_field('link_web'); if(strlen(strstr($field1 , "http")) > 0){ $linkchuan=$field1; }else{ $linkchuan="http://".$field1; } ?> <div class="xem-them"> <a href="<?php echo $linkchuan?>/?id=7" target="_blank" class="nut-xem nut-xem-them">Xem thử</a> <a href="<?php echo get_the_permalink();?>" class="nut-xem nut-xem-chi-tiet">Xem chi tiết</a> </div> <?php } // Add custom Theme Functions here add_action('admin_enqueue_scripts', 'ds_admin_theme_style'); function ds_admin_theme_style() { echo '<style>#flatsome-notice{ display: none; }</style>'; } // Add custom Theme Functions here add_filter('widget_text','execute_php',100); function execute_php($html){ if(strpos($html,"<"."?php")!==false){ ob_start(); eval("?".">".$html); $html=ob_get_contents(); ob_end_clean(); } return $html; } function add_css(){ $version1=uniqid(); wp_register_style( 'thang_css', get_theme_root_uri().'/flatsome-child/thang.css',true,$version1,'all'); wp_enqueue_style( 'thang_css' ); // wp_enqueue_script('thang_js', get_theme_root_uri().'/flatsome-child/thang.js', array(), $version1, true); } add_action( 'wp_enqueue_scripts', 'add_css',1000 ); //code tạo shortcode bài viết liên quan function thang_related_post($content) { if(is_singular('post')) { global $post; ob_start(); $categories = get_the_category($post->ID); if ($categories) { $category_ids = array(); foreach($categories as $individual_category) $category_ids[] = $individual_category->term_id; $args=array( 'category__in' => $category_ids, 'post__not_in' => array($post->ID), 'posts_per_page'=>6, 'ignore_sticky_posts'=>1 ); $my_query = new wp_query( $args ); if( $my_query->have_posts() ) {?> <div class="relatedcat"> <div class="row related-post"> <?php while ($my_query->have_posts()):$my_query->the_post(); ?> <div class="col large-4"> <a href="<?php echo get_the_permalink(); ?>" title="<?php echo get_the_title(); ?>"> <div class="feature"> <div class="image" style="background-image:url(<?php echo get_the_post_thumbnail_url();?>);"></div> </div> </a> <div class="related-title post-title"> <a href="<?php echo get_the_permalink(); ?>" title="<?php echo get_the_title(); ?>"><?php echo get_the_title(); ?></a> </div> <div class='cat-label'> <?php $post = get_post(); $cats = array(); foreach (get_the_category($post_id) as $c) { $cat = get_category($c); array_push($cats, $cat->name); } if (sizeOf($cats) > 0) { $post_categories = implode(', ', $cats); } echo $post_categories; ?> </div> </div> <?php endwhile; ?> </div> </div> <?php } // end if has post } // end if $categories $related_post = ob_get_contents(); ob_end_clean(); return $content.$related_post; } //end if is single post else return $content; } add_shortcode('thang_related_post', 'thang_related_post'); // add_action( 'rest_api_init', function() { register_rest_route( 'affiliate', '/info', [ 'methods' => 'GET', 'callback' => 'get_affiliate_info', 'permission_callback' => '__return_true', ] ); } ); // Get all projects and assign thumbnail function get_affiliate_info( $params ) { global $wpdb; if (is_plugin_active('affiliates/affiliates.php')) { $affiliate_user = null; if (isset($_GET['id'])) { $affiliates_users_table = _affiliates_get_tablename( 'affiliates_users' ); $affiliate_user_id = $wpdb->get_var( $wpdb->prepare( "SELECT user_id FROM $affiliates_users_table WHERE affiliate_id = %d", intval( $_GET['id'] ) ) ); if ( $affiliate_user_id !== null ) { $affiliate_user = get_user_by( 'id', intval( $affiliate_user_id ) ); if ( $affiliate_user ) { // user meta fields require_once AFFILIATES_CORE_LIB . '/class-affiliates-settings.php'; require_once AFFILIATES_CORE_LIB . '/class-affiliates-settings-registration.php'; $registration_fields = Affiliates_Settings_Registration::get_fields(); // remove fields not stored as user meta foreach ( Affiliates_Registration::get_skip_meta_fields() as $key ) { unset( $registration_fields[$key] ); } $data = []; foreach ( $registration_fields as $name => $field ) { if ( $field['enabled'] ) { $value = get_user_meta( $affiliate_user->ID, $name , true ); switch($name) { case "first_name": $data['ho_ten'] = esc_attr( stripslashes( $value ) ); default: $data[$name] = esc_attr( stripslashes( $value ) ); } } } return $data; } } } } return [ 'hotline' => get_option('bnn_info_hotline'), 'linkweb' => get_option('bnn_info_linkweb'), 'mau_sac' => get_option('bnn_info_mau_sac'), 'khau_hieu' => get_option('bnn_info_khau_hieu'), 'ho_ten' => get_option('bnn_info_ho_ten') ]; }