Hi, I'm trying to display two different post types in a view.
The headings are showing up just fine but the images are only showing for one of the post types (see screen shot attached).
I have tried putting the image and heading in a conditional block as seen in screen shot attached.
This will work for about a day or two! Then I'll visit the page a day or two later and see that it isn't working even though I haven't changed anything!
I have tried the conditional block with a toolset container block inside(displaying the image as the background of the container) and with a toolset image block inside. Both work for a bit then cause the same issue.
What should I do to fix it so I can see images from both post types in the same view?
If you have two post types—each with its own customf field group and image field—being output by the View then you would need separate image blocks for each.
You shouldn't really need to worry about conditional blocks, because if there is no source for an image block it will simply output nothing.
The tricky part may occur when inserting the image blocks and selecting the dynamic source.
You may find that you can only set up the source correctly if the first result of the View (which is where you design the View loop output) is the corresponding post type.
(When setting up dynamic sources, it expects that the current post used for the preview actually has some data for the selected dynamic source.)
So if the first result of the View is of post type A, you may have a problem adding an image block where the source should be an image field belonging to post type B.
If you do encounter such a problem you may want to set up the image block for post type A, save the page, then make some temporary change to the View such that the first result is of post type B, and then set up the corresponding image block. Then you can revert the View settings to what they should be.
If it works for some time then stops working there must be some change made on the site to account for it.
If it's okay with you I can check the back end myself to see if I make sure it is set up correctly?
Let me mark your next reply as private so that we can get log-in credentials from you—you may want to create a temporary admin user for us to use that you can later delete. And be sure to have a current backup of your site.
Can you also confirm the url of where we can see the problem.
I looked at your site and can see that it is standard posts for which the images are not being displayed.
And that is to be expected.
In the output of your View loop you have added one image field, and the source for the image field is the Main Featured Image of the Field Group for Product Reviews.
But the Field Group for Product Reviews belongs only to the product review post type, not standard posts, so there is no image from that source to show for posts.
So you need to add two image blocks, one where the source is the field group for product reviews, and another where the source is the field group for posts.
To avoid the possibility that two images could be output, you would put the image blocks inside a conditional block, where the conditions are to test what is the current post type, and display the post image when the post type is post, and the product review image when the post type is product review.
I've done that on your site, and it is working, and I would only expect it to stop working if you save any changes to the page.
(By the way, I did notice one confusing thing that I am going to report, which is when you have multiple post types in a View the dynamic source will insist you choose the "Current Product Review" as a source, for example, even though it could be any of the post types being shown by the View. It works for any post type, but the labelling is confusing, and I'll see if we can get that changed.)