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