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 | |
| $acf_date = get_field($date_field, false, false); | |
| $buddhist_year = (int)substr($acf_date, 0, 4) + 543; | |
| echo date_i18n('j F ', strtotime($acf_date)) . $buddhist_year; |
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 | |
| /** | |
| * Excerpt change from 50 | |
| */ | |
| function seed_excerpt_length( $length ) { | |
| return 100; // Thai uses "Characters", English uses "Words" | |
| } | |
| add_filter( 'excerpt_length', 'seed_excerpt_length', 900 ); | |
| function seed_excerpt_more( $more ) { |
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 | |
| /** | |
| * Excerpt change from 50 | |
| */ | |
| function seed_excerpt_length( $length ) { | |
| return 100; | |
| } | |
| add_filter( 'excerpt_length', 'seed_excerpt_length', 100 ); | |
| function seed_excerpt_more( $more ) { |
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
| .box { | |
| > :last-child { | |
| margin-bottom: 0; | |
| } | |
| } |
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 | |
| /** | |
| * AdvanceForms | |
| */ | |
| function form_post_created( $post, $form, $args ) { | |
| $post->comment_status = 'open'; | |
| wp_update_post( $post ); | |
| update_post_meta($post->ID, '_thumbnail_id', get_field('pic', $post->ID)); | |
| } | |
| add_action( 'af/form/editing/post_created', 'form_post_created', 10, 3 ); |
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 | |
| $args = array( | |
| 'posts_per_page' => 5, | |
| 'post_type' => 'event', | |
| 'meta_key' => 'date', | |
| 'meta_value' => date("Ymd"), | |
| 'meta_compare' => '>', | |
| 'orderby' => 'meta_value_num', | |
| 'order' => 'ASC', | |
| ); |
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
| // ใส่ CSS สำหรับแสดงผล Mobile เช่น | |
| .test { | |
| font-size: 12px; | |
| } | |
| @media (min-width: 768px) { | |
| // โค้ด CSS สำหรับจอ iPad แนวตั้ง เช่น | |
| .test { | |
| font-size: 14px; | |
| } |
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 | |
| /* Custom Thai Province Order */ | |
| if (get_locale() == 'th') { | |
| add_filter( 'woocommerce_states', 'seed_woocommerce_states' ); | |
| } | |
| function seed_woocommerce_states( $states ) { | |
| $states['TH'] = array( | |
| 'TH-81' => 'กระบี่', | |
| 'TH-10' => 'กรุงเทพมหานคร', | |
| 'TH-71' => 'กาญจนบุรี', |
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 | |
| ติดตั้ง Woocommerce php sdk โดยใช้คำสั่งด้านล่างนี้ (ใช้ Command ในการตัดตั้ง) | |
| // composer require automattic/woocommerce | |
| // Setup: | |
| require __DIR__ . '/vendor/autoload.php'; | |
| use Automattic\WooCommerce\Client; | |
| function wc_init() { |