Skip Navigation

[Resolved] Parent featured image not available in view if child CPT has no image

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 1 reply, has 2 voices.

Last updated by Shane 1 year, 4 months ago.

Assigned support staff: Shane.

Author
Posts
#2113265

I have two CPTs; Campaigns and Supporters. Supporters are parents of Campaigns in a one to many relationship.

I set up Campaigns to not have the option to have a featured image (in the toolset>post types options)

When I create a view in a block for campaigns but choosing the parent supporter as the source, the only image I can use in the block is the Supporter's author image; there is no option for the Supporter's featured image in the dropdown for the dynamic source.

Supporters DO have featured images enabled so this isn't expected.

The workaround is to enable featured images for Campaigns. This results in Supporter featured images being shown in the dynamic source dropdown as an option.

#2113435

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Nick,

Thank you for getting in touch.

I did a quick check on this for you and you are correct in that you are not able to display the Parent's featured image on the child using the dynamic sources.

However you should be able to do it by using the shortcode [wpv-post-featured-image] and using the item attribute.

See the documentation below.
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/item-attribute/

With this you're able to provide the parent ID to the shortcode for it to display the featured image.

Thanks,
Shane