Tell us what you are trying to do?
Place a shortcode within a shortcode.
Is there any documentation that you are following?
Using the Editor menu for If conditions.
Is there a similar example that we can see?
Yes
What is the link to your site?
Just need advise thanks.
I could not find specifics on this issue.
I have Map and Article post types.
They are related, Map is parent and Article is child.
I have an Intermediary post type "map-article".
It has a radio button field, selectors are (parent, child, both).
I use a View (selecting the intermediary posts map-article).
I want to display featured image of Map or Article based on radio item selected.
All that said I have a shortcode that WORKS here:
[wpv-conditional if="( '[wpv-post-featured-image output="url" item="@map-article.child"]' ne '' )"]
I would like to use this code but does not work, front end image area is blank:
[wpv-conditional if="( '[wpv-post-featured-image output="url" item="@[wpv-post-type].child"]' ne '' )"]
My guess is the shortcode nesting is too deep?
Please, would you have advice for a shortcode here?
I am not familiar with PHP.
Can you please clarify based on the custom field values (parent,child,both,none) "show-related" what content you want to display?
Basically - the condition would be as follows:
[wpv-conditional if="( '[types field='show-related' output='raw'][/types]' eq 'parent' )"]
// add whatever thing you want to display when "show-related" field value equal to 'parent'
[/wpv-conditional]
[wpv-conditional if="( '[types field='show-related' output='raw'][/types]' eq 'child' )"]
// add whatever thing you want to display when "show-related" field value equal to 'child'
[/wpv-conditional]
[wpv-conditional if="( '[types field='show-related' output='raw'][/types]' eq 'both' )"]
// add whatever thing you want to display when "show-related" field value equal to 'both'
[/wpv-conditional]
I am sorry I think my description my have been too complicated.
The shortcode in this attached image does not work.
I think the problem may be that the nesting is too deep.
I would like to know if there is another way to make this work.
But the shortcode you shared - you are using wrong way.
You added [wpv-post-type] shortcode but instead that you will have to use the post relationship slug.
If you do not know how to use conditoinal statements then please share problem URL where you added those shortcode as well as share admin access details with information about what is your expected result and what you want to display conditoinally.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
This shortcode is within a content template, within a view, that filters for the intermediary post types including map-article.
I guess I didn't explain that well enough in the very beginning above.
If [wpv-post-type] alone in entered into this template it shows on the front end as "map-article", this is not the problem.
[wpv-post-type] does not resolve when used in the code below, but it works otherwise...
[wpv-conditional if="( '[wpv-post-featured-image output="url" item="@[wpv-post-type].child"]' ne '' )"]
P.S.
I think this is the answer to my question. The problem is caused by nesting the shortcode [wpv-post-type] too deep.
I will do it the long way using multiple templates.
Thank you Minesh!
I hope this helps someone else too.