Support » Plugin: ACF Photo Gallery Field » For those having problems in Elementor

  • Resolved samoreen

    (@samoreen)


    Hi,

    When using the original code proposed by the autor, I always got an empty array of images. That’s because the post id is wrong.

    To fix this, replace

    $images = acf_photo_gallery(‘field_name’, $post->ID);

    with

    $images = acf_photo_gallery(‘field_name’, get_the_id());

    Hope this helps.

    Patrick

Viewing 5 replies - 1 through 5 (of 5 total)
  • visiondigital

    (@visiondigital)

    quick question…

    where do we place this code??

    we have this exact problem, but only with ONE post.

    It seems as though this plugin works for previous posts, but not any longer.

    Thanks,

    Thread Starter samoreen

    (@samoreen)

    Hi,

    > where do we place this code??

    Only you know. This code is used in functions.php where you need to retrieve the array of images from the custom field. The code suggested by the author is as follows :

    $images = acf_photo_gallery(‘field_name’, $post->ID);

    But it doesn’t work in Elementor because this is not the correct way to retrieve the post ID in a shortcode. The following code works :

    $images = acf_photo_gallery(‘field_name’, get_the_id());

    I can’t say more. You have to use this code where you need it. I use it in the implementation of a shortcode that I use to display image galleries in Elementor.

    Patrick

    Plugin Author Navneil Naicker

    (@navzme)

    Support for Elementor has been added as of ACF Photo Gallery version 1.7.0

    I did the ACF Photo Gallery yesterday and I get error messages, any ideas? Thank you! “Fatal error: Uncaught Error: Class 'ElementorPro\Modules\DynamicTags\Tags\Base\Data_Tag' not found in /home/customer/www/hometownchiropractic.com/public_html/2022/wp-content/plugins/navz-photo-gallery/includes/elementor_register_tag.php:5 Stack trace: #0 /home/customer/www/hometownchiropractic.com/public_html/2022/wp-content/plugins/navz-photo-gallery/navz-photo-gallery.php(58): include() #1 /home/customer/www/hometownchiropractic.com/public_html/2022/wp-includes/class-wp-hook.php(303): acf_plugin_photo_gallery->register_tags(Object(Elementor\Core\DynamicTags\Manager)) #2 /home/customer/www/hometownchiropractic.com/public_html/2022/wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters('', Array) #3 /home/customer/www/hometownchiropractic.com/public_html/2022/wp-includes/plugin.php(470): WP_Hook->do_action(Array) #4 /home/customer/www/hometownchiropractic.com/public_html/2022/wp-content/plugins/elementor/core/dynamic-tags/manager.php(252): do_action('elementor/dynam...', Object(Elementor\Core\DynamicTags\Manager)) #5 in /home/customer/www/hometownchiropractic.com/public_html/2022/wp-content/plugins/navz-photo-gallery/includes/elementor_register_tag.php on line 5

    Plugin Author Navneil Naicker

    (@navzme)

    @acrenshaw thanks for letting me know. A fix has been added to cater for this. The issue over here is that Elementor Pro plugin isn’t installed that’s why this error throws up. This shouldn’t happen. The fix will be available in 1 or 2 days.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.