Import WordPress article video without iframe

I am importing content from a wordpress blog into a static html web page using the following code:
(as learned from wordpress’s own documentation https://codex.wordpress.org/Integrating_WordPress_with_Your_Website )

<?php
                //Query 5 recent published post in descending order
                $args = array( 'category_name' => 'news', 'posts_per_page' => '-1', 'order' => 'DESC','post_status' => 'publish' );
                $recent_posts = wp_get_recent_posts( $args );
                //Now lets do something with these posts
                foreach( $recent_posts as $recent )
                {
                echo "<section class='main'>";
                echo ''.$recent["post_category"];
                echo '<h4>'.$recent["post_title"];
                echo "</h4>";
                echo '<p class="smalls">';
                echo mysql2date('F, j, Y',$recent["post_date"]);
                echo "</p>";
                echo '<p class="smalls">'.$recent["post_content"];
                echo "</p>";
                echo "</section>";
                //Do whatever else you please with this WordPress post
                }
                ?>

Photos work fine, but when it comes to video the only solution I can find is using an iframe. Otherwise I end up with only a url displayed

Read More

How can I display video from an imported wordpress post without the use of an iframe?

Related posts

Leave a Reply