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 timeline_loop() { | |
$args = array( | |
'meta_key' => 'historical_date', | |
'orderby' => 'meta_value_num', | |
'order' => 'ASC', | |
'posts_per_page'=> '100', | |
); | |
echo '<section id="cd-timeline" class="cd-container">'; |
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_field_one = get_option( 'options_acf_field_one' ); | |
$acf_field_two = get_option( 'options_acf_field_two' ); |
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
// check if this is to be a new post | |
if( $post_id != 'new' ) | |
{ | |
if (get_the_title($post_id) != $_POST['acf']['field_5434172d1d00f'] ){ | |
$update_post = array( | |
'ID' => $post_id, | |
'post_title' => $_POST['acf']['field_5434172d1d00f'] | |
); | |
// Update the post into the database |
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 | |
// get post ID | |
$pid = get_the_ID(); | |
// get our repeater | |
$repeater = get_post_meta( $pid, 'acf_repeater_slug', true ); | |
if( !empty($repeater) ) { | |
for( $i = 0; $i < $repeater; $i++ ) { |
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 | |
// get post ID | |
$pid = get_the_ID(); | |
// acf field | |
$acf_field = get_post_meta( $pid, 'acf_field_slug', true ); |
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 | |
// get post ID | |
$pid = get_the_ID(); | |
// get our repeater | |
$repeater = get_post_meta( $pid, 'acf_repeater_slug', true ); | |
if ( !empty($repeater) ) { | |
for( $i = 0; $i < $repeater; $i++ ) { |
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 | |
/** | |
* Modified from: https://github.com/zzgael/wordpress-acf-custom-location-rule-descendant-of-page | |
*/ | |
add_filter('acf/location/rule_types', 'custom_acf_location_rules_types'); | |
function custom_acf_location_rules_types( $choices ) { | |
$choices['Page']['page_ancestor'] = 'Page Ancestor'; | |
return $choices; | |
} | |
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 Load Field Choices. | |
* | |
* @param array $field The field that we are going to add options to | |
* @return array $field The field we modified | |
*/ | |
function acf_load_field_choices( $field ) { | |
// Reset choices | |
$field['choices'] = array(); |
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 | |
$location = get_field('your_location'); | |
if( !empty($location) ): | |
?> | |
<?php echo $location['lat']; ?> | |
<?php echo $location['lng']; ?> | |
<?php endif; ?> |
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 populate_gravity_forms($field) { | |
echo '<h1>acf/load_field filter debug within populate_gravity_forms()</h1>'; | |
if(class_exists('RGFormsModel')) { | |
$forms_array = array(); | |
$forms = RGFormsModel::get_forms(null, 'title'); | |
foreach($forms as $form) { |