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( | |
'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 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 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 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 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 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 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 | |
/** | |
* Use ACF image field as avatar | |
* @author Mike Hemberger | |
* @link http://thestizmedia.com/acf-pro-simple-local-avatars/ | |
* @uses ACF Pro image field (tested return value set as Array ) | |
*/ | |
add_filter('get_avatar', 'acf_profile_avatar', 10, 5); | |
function acf_profile_avatar( $avatar, $id_or_email, $size, $default, $alt ) { | |
if ( is_numeric( $id_or_email ) ) { |
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
$line: #dcdfe5; | |
$primary: #339833; | |
$primary-active: #1c6808; | |
$gray: #878f9d; | |
div.acf-fields { | |
> .acf-field { | |
padding: 15px 16px; | |
@media (min-width: 768px) { | |
padding: 20px 30px; |
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 | |
/** | |
* ACF Repeater Field : headlines | |
* ACF Sub Field: headline (Post ID) | |
*/ | |
$posts = array(); | |
if (have_rows('headlines')) { | |
while (have_rows('headlines')) { | |
the_row(); |