Plugin Author
Brecht
(@brechtvds)
You can just use the code you can find in their documentation: https://www.advancedcustomfields.com/resources/code-examples/
Kind regards,
Brecht
Hi,
Thanks for your quick reply.
I have tried that, and it works for the first one but then it just repeats the same output in the first post for all the posts.
This is what I have done inside the function in my functions.php, but nothing is outputting :
<div id=”wpupg-container-post-<?php echo $post->ID; ?>” data-id=”<?php echo $post->ID; ?>” data-permalink=”<?php echo get_post_permalink( $post->ID ); ?>” class=”<?php echo implode( ‘ ‘, $classes ); ?>”>
<?php $variable = get_field(‘field_name’); ?>
<?php echo $variable; ?>
</div>
note
the field names above are just for example purposes. the field names are all named correctly
I have been using this guide:
https://bootstrapped.ventures/wp-ultimate-post-grid/code-your-own-template/
-
This reply was modified 8 years, 10 months ago by
charlotted.
-
This reply was modified 8 years, 10 months ago by
charlotted.
I have tried
<?php var_dump ($variable); ?>
but get
string(0) “”
Plugin Author
Brecht
(@brechtvds)
You can pass along the post ID to the function:
https://www.advancedcustomfields.com/resources/get_field/
So something like get_field( ‘field_name’, $post->ID )
Its working, great thanks!