Using ACF custom field in a looper to display related portfolio item featured image

We started using ACF Pro to manage our many custom meta fields and so far so good. As stated in the topic subject line itself…

Our website displays all the products we have released over time. Each item is a portfolio item. In each item, we added a meta field called “product_series” to identify products that belong in the same series.

In the individual portfolio template, I want to add a section at the bottom that displays portfolio items that belong in the same series. What I want to display is the related portfolio item’s featured image and title (which is stored in another meta field). I found a similar topic and the suggestion was to use a looper provider with Query String so I tried:

 post_type=portfolio&meta_key=product_series&meta_value={{dc:acf:post_field field="product_series"}}&meta_compare=%3D&order=DESC

But it didn’t seem to work. I’m guessing that I also need to add something to the source of the Featured Image but I’m a bit stuck on how to proceed.

Hello @dobacco,

Thanks for writing to us.

I would suggest you please update the query string by given query string.

 post_type=portfolio&posts_per_page=3&post_status=publish&ignore_sticky_posts=1&meta_query%5B0%5D%5Bkey%5D=product_series&meta_query%5B0%5D%5Bvalue%5D={{dc:acf:post_field field="product_series"}}&meta_query%5B0%5D%5Bcompare%5D=%3D&order=DESC

If it doesn’t work for you, please share your details in a secure note. Please provide the following details

  • WordPress Login URL
  • Admin level username and password
  • Exact layout URL

You can find the Secure Note button at the bottom of your posts

Thanks

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.