Pro Layouts and default fallback images

We are looking to create a fallback image for posts that do not already have a featured image assigned. In searching the forums we see that users are asked to google how to do custom code and apply that to the child theme layouts - however, we’re wondering what the best practice would be in the case that we have a custom Layout in Pro serving the single post pages where we’ve dynamically specified that the post’s featured image should display on the page in Cornerstone?

Thanks so much!

Hello @dmeyer,

Thanks for writing to us.

In case if you are using the Layout builder, I would suggest you add an Image element where you need to add a placeholder image. Now test the condition like this

After that, you need to set the condition on the Image element where you have set the featured image by using dynamic content code.

Hope it helps
Thanks

That did the trick, thank you so much!

Am I correct in assuming that this can only be done on Image elements and not if using a featured image as a section background?

Hello @dmeyer,

Yes, you can do it on the Image element. In case if you want on the section background you have to add multiple sections and set the condition as I have shown on the above posts.

Hope it helps
Thanks

That makes sense, thank you again. I’ve also been able to apply the same process to the archive pages which is really helpful!

Glad we could help,

Cheers!

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