A
A
Alexander92292021-05-07 13:01:45
AJAX
Alexander9229, 2021-05-07 13:01:45

Smart Custom Fields - how to upload images using Ajax?

There is such a code from the smart custom fields plugin in front-page.php, I need to make it load content via ajax.

$metadata = SCF::get( 'gallery', 16 );
 foreach ( $metadata as $key => $meta ) { ?>
       <div class="item gallery__item gallery__item--<?php echo $key+1; ?> wow animate__animated animate__fadeInUp animate__delay-1s">
           <div class="gallery__image">
                 <img src="<?php echo wp_get_attachment_image_src( $meta['gallery_image'], 'full' )[0]; ?>" data-src="<?php echo wp_get_attachment_image_src( $meta['gallery_image'], 'full' )[0]; ?>" alt="gallery_<?php echo $key+1; ?>">
                 <a data-fslightbox="gallery" href="<?php echo wp_get_attachment_image_src( $meta['gallery_image'], 'full' )[0]; ?>" class="gallery__zoom"></a>
           </div>
       </div>
<?php }


I found such a solution, but as I understand it, it is only suitable for posts - Endless loading

How can I implement this code for the plugin?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question