Support

Account

Home Forums General Issues Generating WP archive if an Image field is used Reply To: Generating WP archive if an Image field is used

  • Hey aloeroot,

    I’m guessing you could create a new page template to pull all the posts that feature the ACF fields you’re looking for. This is how I would do it:

    $args = array(
      'post_type' => 'post',
      'meta_query' => array(
        array(
        'key' => 'spanish_strip', // or any other language
        'value' => '"'. get_the_ID() .'"',
        'compare' => 'LIKE',
        )
      )
    );
    
    $spanish_strips = get_posts($args);
    
    echo '<h1>Archive for Spanish Comic Strips:</h1>';
    
    foreach ($spanish_strips as $strip) : ?>
    <!-- You do something nice here :) -->
    <?php endforeach;

    Note that the get_posts() function only retrieves the last 5 entries, so either add 'numberposts' => -1 to the arguments or use a standard WP_Query.

    Hope this helps!