Answer the question
In order to leave comments, you need to log in
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 }
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question