Skip Navigation

[Resolved] Check if page has parent and use it's featured image

This thread is resolved. Here is a description of the problem and solution.

Problem: How to dispaly parent post featured image conditionally

Solution: you can use [wpv-conditional] shortcode to dispaly conditional output.

You can find proposed solution with the following reply:

Relevant Documentation:

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.


This topic contains 2 replies, has 2 voices.

Last updated by David 5 years, 3 months ago.

Assigned support staff: Minesh.


I am trying to test if a page's parent has a featured image and if so to use the parent's featured image. I expected either of the following code snippets to work but they aren't.

[wpv-conditional if="( '[wpv-post-featured-image id='$parent']' ne '' )"]
	[wpv-post-featured-image id='$parent' size='full' class='post-thumbnail']


[wpv-conditional if="( (empty('[wpv-post-featured-image id='$parent']')) )"]
	[wpv-post-featured-image id='$parent' size='full' class='post-thumbnail']

I confirmed that the shortcode within the conditional does work on it's own but I've got something wrong with my conditional itself. Any help would be appreciated.



Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

I've tested this and following code is working at my end. Could you please try to use following code:

[wpv-conditional if="( '[wpv-post-featured-image output='url' id='$parent']' ne '' )"]
[wpv-post-featured-image id='$parent' size='full' class='post-thumbnail']

I've used "output" attribute.

More info:


Yes, that worked, thank you! I needed to pay more attention to the specific parameters for the featured image shortcode. Again, thank you!