Question Regarding Dynamic Content

Hey All.

I created a custom post type that uses a custom field that relates to another custom post type (recipes that are related to products).

I am attempting to reference this product to display the image/title/url on the page for the Recipe but am running into trouble. I am trying to use this as my dynamic content but it doesn’t seem to work.

{{dc:post:meta post="{{dc:post:meta key=‘featured_product’}}" key=“product_picture_1”}}

Is there a way I can save the {{dc:post:meta key=‘featured_product’}} as a variable that can then be passed to {{dc:post:meta post="[variable would go here]" key=“product_picture_1”}} in order to pull the url of the product image that is connected to the recipe?

Thanks! Let me know if I need to explain it more clearly.

Hi @michigancreative,

Thanks for reaching out!

It seems that query is something like on this thread, I suggest that you check this thread for more information.

If it doesn’t help, would you mind sharing more information and also I would you mind sharing your admin credentials so that we can check your setup properly? To do that, please give us the following information in a Secure Note.

  • WordPress Login URL
  • Admin level username and password

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

Thank you.

Hey Marc,

Thanks so much for linking that to me. I gave it a try but it’s not working :confused:

Would you mind logging into the site and taking a look? The layout I am working on is “Single Recipe” and I’m specifically trying to get the image/link/title to display here:
image

Login information in the secure note.

Hi @michigancreative,

Thanks for providing all your details!

Your setup is just fine, you just need to know what dynamic to use to call the fields from the other custom post type.

Let say for an example. If you want to display this image from your product page to your recipe.

image

Then just click the dynamic content and search for ACF then choose the post field. After that, enter your ACF field name.

Then you can display now the image on your recipe single layout page. You can apply the same steps to your other items. I save the changes and you can check the output in your fettuccine alfredo recipe.

Hope that helps.

Thank you.

1 Like

Hey Marc,

Thanks so much for taking a look at this for me. I tried loading the page but I do not see that the image is being added, is there something I’m missing?

I have the column that the image is in as both the looper provider and looper consumer, but on the front end, nothing prints out.

thanks!

Hello @michigancreative,

The issue is because of your Looper Provider Input. There was an incorrect quotation character. It must be like this : {{dc:acf:post_field field="featured_product"}}. I corrected the issue already using the right quotation. The image is now displaying.

Please check your layout now.

1 Like

Omg you guys are the best! This is perfect and I am so shocked by how robust this dynamic content stuff is, it really helps me do things I would need several plugins and hours of google searching to pull off.

Thanks!

You are most welcome.

1 Like

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