Notifications
Clear all

Using ACF shortcode within iFrame shortcode

2 Posts
2 Users
0 Reactions
1,229 Views
Posts: 1
Topic starter
(@jamesburden)
New Member
Joined: 4 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="https://www.bible.com/en-GB/bible/111/MRK.1.1-11.NIV" 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.

1 Reply
TinyWebGallery
Posts: 923
Admin
(@admin)
Prominent Member
Joined: 16 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

Reply