Clear all

Using ACF shortcode within iFrame shortcode

2 Posts
2 Users
Posts: 1
Topic starter
New Member
Joined: 2 years ago

Hi - I have the latest version of iFrame Pro and was wondering whether it is possible to use an ACF shortcode within the iFrame shortcode. 

The iFrame shortcode I'm using works fine with the URL directly embedded in it like this:

[advanced_iframe use_shortcode_attributes_only="true" src="" width="100%" height="600"]

But ideally I want to be able to set the URL from within custom fields. I'm using ACF and have a field on the custom post type which is the URL that the iFrame needs to display. I tried this as what I assumed was the logical approach:

[advanced_iframe use_shortcode_attributes_only="true" src="[acf field="bible_ref"]" width="100%" height="600"]

But this approach does not work. Is it possible to use an ACF shortcode in the iFrame shortcode parameters in this way?

Thanks so much for your help.

Topic Tags
1 Reply
Posts: 755
Prominent Member
Joined: 14 years ago

yes you can. please check the documentation of the url parameter [] would be a double [] - so you need to replace them by {{ }} 

Also shortcodes are supported. You have to replace the bracket [ with {{ and ] with }}. So if the shortcode is [link] you have to use {{link}} because shortcode attributes which include shortcodes are not supported directly by Wordpress. Also be aware of single and double quotations: src="http://demo.{{url domain='home'}}/url". So only use ' for attributes of the nested shortcode.

Best regards, Michael