{"id":106393,"date":"2018-02-07T20:05:41","date_gmt":"2018-02-07T19:05:41","guid":{"rendered":"https:\/\/nl.wordpress.org\/support\/topic\/get-attachment-for-video\/"},"modified":"2018-02-07T20:05:41","modified_gmt":"2018-02-07T19:05:41","slug":"get-attachment-for-video","status":"publish","type":"topic","link":"https:\/\/nl.wordpress.org\/support\/topic\/get-attachment-for-video\/","title":{"rendered":"Get Attachment for Video"},"content":{"rendered":"<p>Hi guys,<\/p>\n<p>There is a plugin that let&#8217;s me upload a title, description and image with a form.<\/p>\n<p>If you send it, it creates and automatic post with the title, description and the image.<\/p>\n<p>The code for showing the image is:<\/p>\n<pre><code>if ( has_post_thumbnail() &amp;&amp; is_single() ) { \n\t\t$large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), &#039;large&#039; );\n\t\t?&gt;\n\t\t&lt;div class=&quot;attachments&quot;&gt;\n\t\t\t&lt;p class=&quot;image-caption&quot;&gt; &lt;?php _e(&#039;Ingezonden video:&#039;,&#039;feature-request&#039;); ?&gt; &lt;\/p&gt;\n\t\t\t&lt;figure class=&quot;avfr-image post-image&quot;&gt;\n\t\t\t\t&lt;?php \n\t\t\t\techo &#039;&lt;a rel=&quot;lightbox&quot; href=&quot;&#039; . $large_image_url[0] . &#039;&quot; title=&quot;&#039; . the_title_attribute( &#039;echo=0&#039; ) . &#039;&quot;&gt;&#039;;\n\t\t\t\tthe_post_thumbnail( &#039;thumbnail&#039; );\n\t\t\t\techo &#039;&lt;\/a&gt;&#039;;\n\t\t\t\t?&gt;<\/code><\/pre>\n<p>I would like to rewrite the code so that I can upload a video and it automaticly posts the video , just like the image.<\/p>\n<p>Can somebody help me with the code?<\/p>\n","protected":false},"template":"","class_list":["post-106393","topic","type-topic","status-publish","hentry","topic-tag-attachment","topic-tag-form","topic-tag-post","topic-tag-video"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/nl.wordpress.org\/support\/wp-json\/wp\/v2\/topic\/106393","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nl.wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/nl.wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/nl.wordpress.org\/support\/wp-json\/wp\/v2\/topic\/106393\/revisions"}],"wp:attachment":[{"href":"https:\/\/nl.wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=106393"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}