Just so there’s a working solution posted for whomever might need it, here’s what I came up with. Thanks for your help.
$striptype = sanitize_text_field( get_query_var( 'striptype' ) ); // calls the striptype from the URL and sanitizes the input so we can have one archive page that brings up archives in different languages
$posts = get_posts(array(
'posts_per_page' => 25,
'post_type' => 'post',
'orderby' => 'date',
'order' => 'ASC',
'meta_query' => array (
array (
'key' => $striptype, //this queries the metadata on the strips, in this case the advanced custom fields, looking for any that are not empty
'value' => '',
'compare' => '!=',
),
),
));
and then further down to actually display the retrieved images there’s one of these code blocks for every language:
if ($striptype == 'spanish_strip') {
$image = get_field('spanish_strip');
$size = 'full'; // (thumbnail, medium, large, full or custom size)
if( $image ) {
//echo "<strong>Spanish Strip:</strong><br>";
echo wp_get_attachment_image( $image, $size );
echo "<br><br>";
}
Bump – still going on. If I deactivate ACF I can use the Add Media button again.
Thanks John – disabling ACF showed nothing, which then helped remind me that I’d coded a special plugin for this site, too, and lo and behold the custom function was in the plugin. I don’t normally use plugins, but this site is extra complex.
Resolved, and may it possibly be helpful to someone else later.
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!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.