So I am trying to have quick boolean check to see if the blog post, which is single.php
contains any youtube video embedded, and if it does, then display an video embedded image on the home.php
page.
I thought the best way to approach is by string finder using php
since all youtube
video embedded contains HTML that looks like this:
inframe src="http://www.youtube.com/embed/...
However, the thing is I have no idea where to start out.. If someone could help me how to start out, that will be great! Thank you!
If all the embeded youtube videos are iframes, this should work:
Why don’t you just use a Blog Category called “with video” and then run a loop with just that cat on the home page?