Working with Wordpress now. Struggling with Foogallery and ACF. I have created ACF fields for FooGalleries.
Then, I am trying to call the fields within PHP (namely the code for a static sidebar), with the intention to echo them in a post page where the (Foo)Gallery is showing (in the sidebar).
For context, these 2 ACF fields with a title and a description for each Gallery.
Wordpress does not seem to find the fields.
Have tried with do_shortcode(), with get_field(), none works. (get_field returns false):
<?php
$a=get_field('foogallery-title-fr', 868);
echo do_shortcode("[acf field='foogallery-title-fr' post_id='868']");
?>
$a returns false and echo doesn't echo.
foogallery-title-fr is the name of the ACF field attached to the (foo)gallery id 868. The ACF fields show without problem on the (foo)gallery page.
868 is also the post ID when I am on the gallery page.
Going nuts and can't find anybody who seems to have tried to do the same...
After receiving your images it seems you're just trying to use basic ACF functions.
To get an ACF Field:
To display an ACF Field:
To get an ACF Field from another post:
To display an ACF Field from another post:
Here is the information on using fields from different posts: https://www.advancedcustomfields.com/resources/how-to-get-values-from-another-post/
If none of that works try the following: