Support

Account

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

Unread

Generating WP archive if an Image field is used

  • Hi there; could use some pointers, please. I’ve got a WordPress site that shows comic strips. Each page has an English comic at the top, and I’m using ACF Image fields to include translated versions underneath, if available. For example, the fields are called spanish_strip and japanese_strip, etc.

    I’d like to create an archive page that includes records where the spanish_strip field has been used, or where japanese_strip field has an entry, so users could look up “spanish strips” and find all those collected together, or “japanese strips” and find those on one page.

    I think it could be done via something like this:

    $posts = get_posts(array(
    	'posts_per_page'	=> -1,
    	'post_type'		=> 'post',
    	'meta_key'		=> 'spanish_strip',
    	'meta_value'	=> '?????'
    ));

    I don’t know how to pull posts where the value of spanish_strip is basically just “not empty”, since the ID will be different for every image. I have the field set to return
    an image ID.

    Could anyone suggest a way to handle this?

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.