static variable loop not working in WordPress

I have a function in my wordpress theme that deletes the first embedded video in a video post. See code below. This is in the functions.php file. /* – function that hides first video in post content – */ function process_embed( $embed ){ if ( is_single() && get_post_format() === ‘video’ ) { static $post_video_num = … Read more

how to create a conditional content_width for a wordpress theme?

I’m trying to create a conditional statement for the content width in the functions.php of my theme. So some categories will have a content_width of 580, some will have 900. This will make the oEmbed work correctly wherever it’s used. Usually, you would have this in your functions.php: if ( ! isset( $content_width ) ) … Read more

What are the Oembed Links For?

My copy of WordPress outputs two <link/> tags in the header of (nearly?) every page. They look like this. <link rel=”alternate” type=”application/json+oembed” href=”http://example.com/wp-json/oembed/1.0/embed?url=http%3A%2F%2Fexample.com%2Fbust%2F” /> <link rel=”alternate” type=”text/xml+oembed” href=”http://example.com/wp-json/oembed/1.0/embed?url=http%3A%2F%2Fexample.com%2Fbust%2F&#038;format=xml” /> What are these oembed links for? Do they need to be here for WordPress to do things? Or are they here so other sites can better … Read more

WP Oembed not passing through the “autoplay=1” variable

I’m having a problem here: I am passing this through a custom field: http://www.youtube.com/watch?v=E6P1Q-UycHA&autoplay=1 (notice the autoplay=1) But when I load the video on my theme using wp_oembed_get… it displays the video fine, but it does not listen to the autoplay=1 variable I am passing through. I need the videos to play on the load … Read more

How to wrap oEmbed-embedded video in DIV tags inside the_content?

I am making a WordPress Theme for a website with video tutorials. I would like to put the video that is embedded in the content (with oEmbed) in a apart div. An example The full content (output from the_content()) is something like this: <p><iframe src=”http://player.vimeo.com/video/0000000″ width=”900″ height=”506″ frameborder=”0″ webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></p> <p>This is an Test … Read more