DocumentationOnline documentation for Ajax Load More
Custom Fields
To access custom field values in a Repeater Template you must define global $post; at the top of the repeater and pass the $post->ID to the custom field function.
1 2 3 4 5 6 7 8 9 10 11 |
<!-- Repeater Template --> <li> <?php global $post; ?> <?php // Standard $value = get_post_meta( $post->ID, 'custom_field_name', true ); // Advanced Custom Fields $value = get_field('custom_field_name', $post->ID); ?> </li> |
Pro Tip: Don’t forget to declare global $post; at the opening of your template