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
| /* Add Category Name to body_class */ | |
| add_filter('body_class','moss_add_category_to_single'); | |
| function moss_add_category_to_single($classes) { | |
| if (is_single() ) { | |
| global $post; | |
| foreach((get_the_category($post->ID)) as $category) { | |
| $classes[] = 'category-' . $category->category_nicename; | |
| } | |
| } |
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 $user = wp_get_current_user();?> | |
| <h3 class="name"><?php echo $user->first_name . ' ' . $user->last_name;?></h3> | |
| <div class="profile"> | |
| <div class="contact"> | |
| <p><?php echo $user->user_email; ?></p> | |
| <p><?php echo $user->billing_phone; ?></p> | |
| </div> | |
| <div class="address"> | |
| <p> | |
| <?php |
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 | |
| // Ref: https://guides.wp-bullet.com/how-to-use-mailgun-with-wordpress-multisite-http-api-or-smtp/ | |
| //Mailgun multisite stuff | |
| define('MAILGUN_USEAPI', true); | |
| define('MAILGUN_APIKEY', 'key-YourAPIKeyHere'); | |
| define('MAILGUN_DOMAIN', 'mg.youdomain.com' ); | |
| define('MAILGUN_SECURE', true); | |
| // Set the from name and from address |
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
| กระบี่ | |
| กรุงเทพมหานคร | |
| กาญจนบุรี | |
| กาฬสินธุ์ | |
| กำแพงเพชร | |
| ขอนแก่น | |
| จันทบุรี | |
| ฉะเชิงเทรา | |
| ชลบุรี | |
| ชัยนาท |
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 | |
| // Set the Default Theme for WordPress Multisite | |
| define( 'WP_DEFAULT_THEME', 'plant' ); |
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 | |
| function sw_setup() { | |
| if(get_option('page_on_front')=='0' && get_option('show_on_front')=='posts') { | |
| // Create homepage | |
| $homepage = array( | |
| 'post_type' => 'page', | |
| 'post_title' => 'Home', | |
| 'post_content' => '', | |
| 'post_status' => 'publish', | |
| 'post_author' => 1 |
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 | |
| // from https://github.com/sybrew/the-seo-framework/issues/541 | |
| add_filter( 'the_seo_framework_image_generation_params', function( $params ) { | |
| unset( $params['cbs']['content'] ); | |
| return $params; | |
| } ); |
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
| jQuery(document).ready(function ($) { | |
| acf.add_filter("date_picker_args", function (args, $field) { | |
| if ($field.hasClass("birth_date")) { | |
| args["minDate"] = "-8y"; //ref: https://api.jqueryui.com/datepicker/ | |
| args["maxDate"] = "-1d"; | |
| } | |
| return args; | |
| }); | |
| }); |
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 // Show related post from "Related Posts for WordPress By Never5" WordPress Plugin | |
| $p_id = get_the_ID(); | |
| $link_args = array( | |
| 'post_type' => 'rp4wp_link', | |
| 'posts_per_page' => 6, | |
| 'meta_query' => array( | |
| array( | |
| 'key' => 'rp4wp_parent', |
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( 'forminator_form_after_handle_submit', 'ws_get_message', 10, 2 ); | |
| add_action( 'forminator_form_after_save_entry', 'ws_get_message', 10, 2 ); | |
| // เก็บข้อความจากฟอร์มแล้วส่งไลน์ | |
| function ws_get_message($form_id, $response) { | |
| // ===แก้ตรงนี้===== |