$i = 0;
$page = get_the_content();
$doc=new DOMDocument();
foreach ($images as $img) {
list($width, $height, $type, $attr) = getimagesize($img['src']);

if ($height > 149 ) {  
    echo '<img src="' . $img['src'] . '" alt=" ' . $img['alt'] . ' - funny and hot pictures" title=" ' . $img['title'] . ' - funny fail picture dump" onerror=\'this.style.display="none" \'><br>';
if ($i == 3 ) { break;}
// don't display

I changed the "<?php the_content(); ?>" bit of code using the one above. It's designed to strip out all the text during my publish and merely leave the pictures so it does nicely. However when I embed a relevant video the php breaks. Wouldso would I allow posts show youtube videos?

You need to consider using custom fields:


There's an excellent wordpress plugin that produces good admin control sections on their behalf too:


You could utilize a custom area to particularly put a relevant video in to the page.

It is possible to particular reason you need to strip the written text from the publish? - e.g. would you simply not put text within the publish whatsoever? - or is the text be placed in to the excerpt rather, or right into a custom area to ensure that it's not necessary to over complicate the output code?