Support

Account

Forum Replies Created

  • 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.

Viewing 3 posts - 1 through 3 (of 3 total)