Hello ACF community !
I started experimenting with ACF (free) a few days ago. I created a custom post type with one ACF image field. I confess I’m trying to make a gallery out of that.
Using that thread that was (very) useful for my situation.
I made a loop to display the content of that CPT ‘escaliers‘: a single image field called ‘portfolio‘.
<?php get_header(); $args = array( 'numberposts' => -1, 'post_type' => 'escaliers', ); $the_query = new WP_Query( $args );?> <?php if( $the_query->have_posts() ): ?> <figure class="wp-block-gallery columns-3 is-cropped row"> <ul class="blocks-gallery-grid"> <?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?> <li class="blocks-gallery-item"> <figure> <img width="1024" height="765" src="<?php the_field('portfolio') ?>"> </figure> </li> <?php endwhile; wp_reset_postdata(); ?> </ul> </figure> <?php endif; ?> <?php wp_reset_query(); // Restore global post data stomped by the_post(). ?> <?php get_footer(); ?>
It worked like a charm until this morning when img src in the DOM are filled with “src(unknown)”. Should I use the custom post type ID to refer to the image field ?
If not the template, could have it been from the switch to https or the installation of a cache extension ?
Thank you for your answer ! The issue came from the SSL certificate that expired on the 1st of october, a few hours after I experimented with that. It’s now fixed and this code is working again.
I asked myself the same questions but didn’t get much debug information, with devtools the src in image tag wasn’t filled with the image link and no error would come up. I did check if all the links in medias were in https and they were.
I don’t have much knowledge in the server side but I guess it wouldn’t let wordpress process https links when its SSL certificate is expired.
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!