{"id":1328715,"date":"2017-08-01T05:53:01","date_gmt":"2017-08-01T12:53:01","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/embed-video-in-iframe-dynamically-via-php\/"},"modified":"2017-08-17T07:27:06","modified_gmt":"2017-08-17T14:27:06","slug":"embed-video-in-iframe-dynamically-via-php","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/embed-video-in-iframe-dynamically-via-php\/","title":{"rendered":"Embed Video in Iframe dynamically via PHP?"},"content":{"rendered":"<p>Hi Support,<\/p>\n<p>Love the plugin, and you guys have been fantastic! Have an interesting question that i&#8217;m hoping you can help me with and maybe be of use to other users.<\/p>\n<p>We&#8217;ve had requests to embed video on our event posts and have managed to do this fine by adding youtube embed link to the event description.<\/p>\n<p>However what we want to do is dynamically add video at full width &#8216;outside of the event description&#8217; by using the Tribe Additional Fields functions.<\/p>\n<p>I&#8217;ve been attempting something along the lines of adding an Iframe to the single-event.php loop and inserting PHP to call the content of an &#8216;additional video field URL&#8217;.<\/p>\n<p>Such as:<\/p>\n<pre><code>&lt;iframe width=\"560\" height=\"315\" src=\"\r\n\r\n&lt;?php $additional_fields = tribe_get_custom_fields(); ?&gt;\r\n &lt;?php echo $additional_fields['Video'];?&gt;\"\r\n\r\nframeborder=\"0\" allowfullscreen&gt;&lt;\/iframe&gt;<\/code><\/pre>\n<p>and on the back-end<\/p>\n<p><code>Video: https:\/\/www.youtube.com\/watch?v=NLCX9Q-ranM<\/code><\/p>\n<p>The iframe is displaying however failing to load the URL from the additional field, instead showing an iframe of a 404.<br \/>\nI might be barking up completely the wrong tree here but as I understand it Iframes do accept PHP.<\/p>\n<p>Is this at all possible? Understand would need to verify the iframe as it would be insecure but was hoping to make it as easy as possible for users to add video to the events via a simple additional field url with the embedded video looking full and impressive at full width beneath all the event info.<\/p>\n<p>Look forward to hearing your thoughts,<\/p>\n<p>Many Thanks,<br \/>\nOli<\/p>\n","protected":false},"template":"","class_list":["post-1328715","topic","type-topic","status-closed","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Embed Video in Iframe dynamically via PHP? -<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/embed-video-in-iframe-dynamically-via-php\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Embed Video in Iframe dynamically via PHP? -\" \/>\n<meta property=\"og:description\" content=\"Hi Support, Love the plugin, and you guys have been fantastic! Have an interesting question that i&#8217;m hoping you can help me with and maybe be of use to other users. We&#8217;ve had requests to embed video on our event posts and have managed to do this fine by adding youtube embed link to the [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/embed-video-in-iframe-dynamically-via-php\/\" \/>\n<meta property=\"article:modified_time\" content=\"2017-08-17T14:27:06+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/embed-video-in-iframe-dynamically-via-php\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/embed-video-in-iframe-dynamically-via-php\/\",\"name\":\"Embed Video in Iframe dynamically via PHP? -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2017-08-01T12:53:01+00:00\",\"dateModified\":\"2017-08-17T14:27:06+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/embed-video-in-iframe-dynamically-via-php\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/embed-video-in-iframe-dynamically-via-php\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/embed-video-in-iframe-dynamically-via-php\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/theeventscalendar.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Topics\",\"item\":\"https:\/\/theeventscalendar.com\/support\/topics\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Calendar Products\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Events Calendar PRO\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Embed Video in Iframe dynamically via PHP?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\",\"url\":\"https:\/\/theeventscalendar.com\/support\/\",\"name\":\"\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Embed Video in Iframe dynamically via PHP? -","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/embed-video-in-iframe-dynamically-via-php\/","og_locale":"en_US","og_type":"article","og_title":"Embed Video in Iframe dynamically via PHP? -","og_description":"Hi Support, Love the plugin, and you guys have been fantastic! Have an interesting question that i&#8217;m hoping you can help me with and maybe be of use to other users. We&#8217;ve had requests to embed video on our event posts and have managed to do this fine by adding youtube embed link to the [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/embed-video-in-iframe-dynamically-via-php\/","article_modified_time":"2017-08-17T14:27:06+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/embed-video-in-iframe-dynamically-via-php\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/embed-video-in-iframe-dynamically-via-php\/","name":"Embed Video in Iframe dynamically via PHP? -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2017-08-01T12:53:01+00:00","dateModified":"2017-08-17T14:27:06+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/embed-video-in-iframe-dynamically-via-php\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/embed-video-in-iframe-dynamically-via-php\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/embed-video-in-iframe-dynamically-via-php\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/theeventscalendar.com\/support\/"},{"@type":"ListItem","position":2,"name":"Topics","item":"https:\/\/theeventscalendar.com\/support\/topics\/"},{"@type":"ListItem","position":3,"name":"Calendar Products","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/"},{"@type":"ListItem","position":4,"name":"Events Calendar PRO","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/"},{"@type":"ListItem","position":5,"name":"Embed Video in Iframe dynamically via PHP?"}]},{"@type":"WebSite","@id":"https:\/\/theeventscalendar.com\/support\/#website","url":"https:\/\/theeventscalendar.com\/support\/","name":"","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1328715","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":2,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1328715\/revisions"}],"predecessor-version":[{"id":1333778,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1328715\/revisions\/1333778"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1328715"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}