title: How to Prevent Embedded Vimeo From Playing Automatically
body: <p>I had someone work on a horizontal slider for this wordpress powered site: <a href="http://lifebridgecypress.org" rel="nofollow">http://lifebridgecypress.org</a>.  It's setup where the homepage auto-plays the embedded Vimeo video, which only shows as the first slide on the homepage.  For any other page on the site, the video is not displayed, which is what I want.  But I don't know enough to know how to change the code to where the video WILL NOT play automatically when the user gets to the homepage.  <strong>So, I'd like it to be setup where the video WILL NOT play automatically.</strong></p>
  
  <p>I'd also like to know if there's a cleaner way to setup the code to accomplish the same result.  Here's the code...</p>
  
  <pre><code>&lt;?php 
  $options = get_option( 'sample_theme_options' );
  
  $slide_1_title = $options['sometext11'];
  $slide_1_image = $options['sometext12'];
  $slide_1_url = $options['sometext13'];
  $slide_1_text = $options['sometextarea1'];
  
  $slide_2_title = $options['sometext21'];
  $slide_2_image = $options['sometext22'];
  $slide_2_url = $options['sometext23'];
  $slide_2_text = $options['sometextarea2'];
  
  $slide_3_title = $options['sometext31'];
  $slide_3_image = $options['sometext32'];
  $slide_3_url = $options['sometext33'];
  $slide_3_text = $options['sometextarea3'];
  
  $slide_4_title = $options['sometext41'];
  $slide_4_image = $options['sometext42'];
  $slide_4_url = $options['sometext43'];
  $slide_4_text = $options['sometextarea4'];
  
  $slide_5_title = $options['sometext51'];
  $slide_5_image = $options['sometext52'];
  $slide_5_url = $options['sometext53'];
  $slide_5_text = $options['sometextarea5'];
  
  $slide_6_title = $options['sometext61'];
  $slide_6_image = $options['sometext62'];
  $slide_6_url = $options['sometext63'];
  $slide_6_text = $options['sometextarea6'];
  ?&gt;
      &lt;div id="newsSlider"&gt; 
     &lt;div class="lbutton"&gt; 
      &lt;a href="#" class="previous"&gt;&lt;/a&gt; 
     &lt;/div&gt;
  
  &lt;div class="container"&gt; 
  &lt;!--&lt;div class="ltrans"&gt;&lt;/div&gt; --&gt;
  &lt;ul class="slides"&gt; 
  &lt;?php if (is_home()) { ?&gt;&lt;?php if (!empty($slide_1_image)) { ?&gt;
  &lt;li&gt;
  &lt;div class="left1slider"&gt;
  &lt;?php if (preg_match ("/\b(?:vimeo)\.com\b/i", $slide_1_image)) { 
  // replace
           $video_vim  = $slide_1_image;
           $vimdomain = array("http://vimeo.com/");
           $blank_text   = array("");
           $vim_id = str_replace($vimdomain, $blank_text, $video_vim);
  ?&gt;
  &lt;object width="648" height="356"&gt;&lt;param name="allowfullscreen" value="true" /&gt;&lt;param name="allowscriptaccess" value="always" /&gt;&lt;param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=&lt;?php echo $vim_id; ?&gt;&amp;amp;server=vimeo.com&amp;amp;show_title=1&amp;amp;show_byline=0&amp;amp;show_portrait=0&amp;amp;color=00ADEF&amp;amp;fullscreen=0&amp;amp;autoplay=1&amp;amp;loop=0" /&gt;&lt;embed src="http://vimeo.com/moogaloop.swf?clip_id=&lt;?php echo $vim_id; ?&gt;&amp;amp;server=vimeo.com&amp;amp;show_title=1&amp;amp;show_byline=0&amp;amp;show_portrait=0&amp;amp;color=00ADEF&amp;amp;fullscreen=0&amp;amp;autoplay=1&amp;amp;loop=0" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="648" height="356"&gt;&lt;/embed&gt;&lt;/object&gt;
           &lt;?php } else { ?&gt;
              &lt;a href="&lt;?php echo $slide_1_url; ?&gt;" rel="bookmark"&gt;
              &lt;img src="&lt;?php echo $slide_1_image; ?&gt;" width="648" height="356" alt="thumb" /&gt;
              &lt;/a&gt;
           &lt;?php } ?&gt;
           &lt;/div&gt;
           &lt;div class="left2slider"&gt;
           &lt;h4&gt;&lt;?php echo $slide_1_title; ?&gt;&lt;/h4&gt;
           &lt;p&gt;
           &lt;?php print nl2br($slide_1_text); ?&gt;
              &lt;br&gt;
              &lt;a href="&lt;?php echo $slide_1_url; ?&gt;" class="readmore"&gt;GET DIRECTIONS...&lt;/a&gt;
          &lt;/p&gt;
           &lt;/div&gt;
              &lt;/li&gt;
              &lt;?php } // END OF SLIDER ?&gt; &lt;?php } // dont show first slider on site except on homepage ?&gt;
  
              &lt;?php if (!empty($slide_2_image)) { ?&gt;
              &lt;li&gt;
           &lt;div class="left1slider"&gt;
           &lt;?php if (preg_match ("/\b(?:vimeo)\.com\b/i", $slide_2_image)) { 
           // replace
           $video_vim  = $slide_2_image;
           $vimdomain = array("http://vimeo.com/");
           $blank_text   = array("");
           $vim_id = str_replace($vimdomain, $blank_text, $video_vim);
           ?&gt;
           &lt;object width="648" height="356"&gt;&lt;param name="allowfullscreen" value="true" /&gt;&lt;param name="allowscriptaccess" value="always" /&gt;&lt;param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=&lt;?php echo $vim_id; ?&gt;&amp;amp;server=vimeo.com&amp;amp;show_title=1&amp;amp;show_byline=0&amp;amp;show_portrait=0&amp;amp;color=00ADEF&amp;amp;fullscreen=0&amp;amp;autoplay=1&amp;amp;loop=0" /&gt;&lt;embed src="http://vimeo.com/moogaloop.swf?clip_id=&lt;?php echo $vim_id; ?&gt;&amp;amp;server=vimeo.com&amp;amp;show_title=1&amp;amp;show_byline=0&amp;amp;show_portrait=0&amp;amp;color=00ADEF&amp;amp;fullscreen=0&amp;amp;autoplay=1&amp;amp;loop=0" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="648" height="356"&gt;&lt;/embed&gt;&lt;/object&gt;
           &lt;?php } else { ?&gt;
              &lt;a href="&lt;?php echo $slide_2_url; ?&gt;" rel="bookmark"&gt;
              &lt;img src="&lt;?php echo $slide_2_image; ?&gt;" width="648" height="356" alt="thumb" /&gt;
              &lt;/a&gt;
           &lt;?php } ?&gt;
           &lt;/div&gt;
           &lt;div class="left2slider"&gt;
           &lt;h4&gt;&lt;?php echo $slide_2_title; ?&gt;&lt;/h4&gt;
           &lt;p&gt;
           &lt;?php print nl2br($slide_2_text); ?&gt;
              &lt;br&gt;
              &lt;a href="&lt;?php echo $slide_2_url; ?&gt;" class="readmore"&gt;Read More...&lt;/a&gt;
          &lt;/p&gt;
           &lt;/div&gt;
              &lt;/li&gt;
              &lt;?php } // END OF SLIDER ?&gt;
  
              &lt;?php if (!empty($slide_3_image)) { ?&gt;
              &lt;li&gt;
           &lt;div class="left1slider"&gt;
           &lt;?php if (preg_match ("/\b(?:vimeo)\.com\b/i", $slide_3_image)) { 
           // replace
           $video_vim  = $slide_3_image;
           $vimdomain = array("http://vimeo.com/");
           $blank_text   = array("");
           $vim_id = str_replace($vimdomain, $blank_text, $video_vim);
           ?&gt;
           &lt;object width="648" height="356"&gt;&lt;param name="allowfullscreen" value="true" /&gt;&lt;param name="allowscriptaccess" value="always" /&gt;&lt;param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=&lt;?php echo $vim_id; ?&gt;&amp;amp;server=vimeo.com&amp;amp;show_title=1&amp;amp;show_byline=0&amp;amp;show_portrait=0&amp;amp;color=00ADEF&amp;amp;fullscreen=0&amp;amp;autoplay=1&amp;amp;loop=0" /&gt;&lt;embed src="http://vimeo.com/moogaloop.swf?clip_id=&lt;?php echo $vim_id; ?&gt;&amp;amp;server=vimeo.com&amp;amp;show_title=1&amp;amp;show_byline=0&amp;amp;show_portrait=0&amp;amp;color=00ADEF&amp;amp;fullscreen=0&amp;amp;autoplay=1&amp;amp;loop=0" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="648" height="356"&gt;&lt;/embed&gt;&lt;/object&gt;
           &lt;?php } else { ?&gt;
              &lt;a href="&lt;?php echo $slide_3_url; ?&gt;" rel="bookmark"&gt;
              &lt;img src="&lt;?php echo $slide_3_image; ?&gt;" width="648" height="356" alt="thumb" /&gt;
              &lt;/a&gt;
           &lt;?php } ?&gt;
           &lt;/div&gt;
           &lt;div class="left2slider"&gt;
           &lt;h4&gt;&lt;?php echo $slide_3_title; ?&gt;&lt;/h4&gt;
           &lt;p&gt;
           &lt;?php print nl2br($slide_3_text); ?&gt;
              &lt;br&gt;
              &lt;a href="&lt;?php echo $slide_3_url; ?&gt;" class="readmore"&gt;More on 50/50...&lt;/a&gt;
          &lt;/p&gt;
           &lt;/div&gt;
              &lt;/li&gt;
              &lt;?php } // END OF SLIDER ?&gt;
  
              &lt;?php if (!empty($slide_4_image)) { ?&gt;
              &lt;li&gt;
           &lt;div class="left1slider"&gt;
           &lt;?php if (preg_match ("/\b(?:vimeo)\.com\b/i", $slide_4_image)) { 
           // replace
           $video_vim  = $slide_4_image;
           $vimdomain = array("http://vimeo.com/");
           $blank_text   = array("");
           $vim_id = str_replace($vimdomain, $blank_text, $video_vim);
           ?&gt;
           &lt;object width="648" height="356"&gt;&lt;param name="allowfullscreen" value="true" /&gt;&lt;param name="allowscriptaccess" value="always" /&gt;&lt;param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=&lt;?php echo $vim_id; ?&gt;&amp;amp;server=vimeo.com&amp;amp;show_title=1&amp;amp;show_byline=0&amp;amp;show_portrait=0&amp;amp;color=00ADEF&amp;amp;fullscreen=0&amp;amp;autoplay=1&amp;amp;loop=0" /&gt;&lt;embed src="http://vimeo.com/moogaloop.swf?clip_id=&lt;?php echo $vim_id; ?&gt;&amp;amp;server=vimeo.com&amp;amp;show_title=1&amp;amp;show_byline=0&amp;amp;show_portrait=0&amp;amp;color=00ADEF&amp;amp;fullscreen=0&amp;amp;autoplay=1&amp;amp;loop=0" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="648" height="356"&gt;&lt;/embed&gt;&lt;/object&gt;
           &lt;?php } else { ?&gt;
              &lt;a href="&lt;?php echo $slide_4_url; ?&gt;" rel="bookmark"&gt;
              &lt;img src="&lt;?php echo $slide_4_image; ?&gt;" width="648" height="356" alt="thumb" /&gt;
              &lt;/a&gt;
           &lt;?php } ?&gt;
           &lt;/div&gt;
           &lt;div class="left2slider"&gt;
           &lt;h4&gt;&lt;?php echo $slide_4_title; ?&gt;&lt;/h4&gt;
           &lt;p&gt;
           &lt;?php print nl2br($slide_4_text); ?&gt;
              &lt;br&gt;
              &lt;a href="&lt;?php echo $slide_4_url; ?&gt;" class="readmore"&gt;Read More about 72...&lt;/a&gt;
          &lt;/p&gt;
           &lt;/div&gt;
              &lt;/li&gt;
              &lt;?php } // END OF SLIDER ?&gt;
  
              &lt;?php if (!empty($slide_5_image)) { ?&gt;
              &lt;li&gt;
           &lt;div class="left1slider"&gt;
           &lt;?php if (preg_match ("/\b(?:vimeo)\.com\b/i", $slide_5_image)) { 
           // replace
           $video_vim  = $slide_5_image;
           $vimdomain = array("http://vimeo.com/");
           $blank_text   = array("");
           $vim_id = str_replace($vimdomain, $blank_text, $video_vim);
           ?&gt;
           &lt;object width="648" height="356"&gt;&lt;param name="allowfullscreen" value="true" /&gt;&lt;param name="allowscriptaccess" value="always" /&gt;&lt;param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=&lt;?php echo $vim_id; ?&gt;&amp;amp;server=vimeo.com&amp;amp;show_title=1&amp;amp;show_byline=0&amp;amp;show_portrait=0&amp;amp;color=00ADEF&amp;amp;fullscreen=0&amp;amp;autoplay=1&amp;amp;loop=0" /&gt;&lt;embed src="http://vimeo.com/moogaloop.swf?clip_id=&lt;?php echo $vim_id; ?&gt;&amp;amp;server=vimeo.com&amp;amp;show_title=1&amp;amp;show_byline=0&amp;amp;show_portrait=0&amp;amp;color=00ADEF&amp;amp;fullscreen=0&amp;amp;autoplay=1&amp;amp;loop=0" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="648" height="356"&gt;&lt;/embed&gt;&lt;/object&gt;
           &lt;?php } else { ?&gt;
              &lt;a href="&lt;?php echo $slide_5_url; ?&gt;" rel="bookmark"&gt;
              &lt;img src="&lt;?php echo $slide_5_image; ?&gt;" width="648" height="356" alt="thumb" /&gt;
              &lt;/a&gt;
           &lt;?php } ?&gt;
           &lt;/div&gt;
           &lt;div class="left2slider"&gt;
           &lt;h4&gt;&lt;?php echo $slide_5_title; ?&gt;&lt;/h4&gt;
           &lt;p&gt;
           &lt;?php print nl2br($slide_5_text); ?&gt;
              &lt;br&gt;
              &lt;a href="&lt;?php echo $slide_5_url; ?&gt;" class="readmore"&gt;Read More Details...&lt;/a&gt;
          &lt;/p&gt;
           &lt;/div&gt;
              &lt;/li&gt;
              &lt;?php } // END OF SLIDER ?&gt;
  
              &lt;?php if (!empty($slide_6_image)) { ?&gt;
              &lt;li&gt;
           &lt;div class="left1slider"&gt;
           &lt;?php if (preg_match ("/\b(?:vimeo)\.com\b/i", $slide_6_image)) { 
           // replace
           $video_vim  = $slide_6_image;
           $vimdomain = array("http://vimeo.com/");
           $blank_text   = array("");
           $vim_id = str_replace($vimdomain, $blank_text, $video_vim);
           ?&gt;
           &lt;object width="648" height="356"&gt;&lt;param name="allowfullscreen" value="true" /&gt;&lt;param name="allowscriptaccess" value="always" /&gt;&lt;param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=&lt;?php echo $vim_id; ?&gt;&amp;amp;server=vimeo.com&amp;amp;show_title=1&amp;amp;show_byline=0&amp;amp;show_portrait=0&amp;amp;color=00ADEF&amp;amp;fullscreen=0&amp;amp;autoplay=1&amp;amp;loop=0" /&gt;&lt;embed src="http://vimeo.com/moogaloop.swf?clip_id=&lt;?php echo $vim_id; ?&gt;&amp;amp;server=vimeo.com&amp;amp;show_title=1&amp;amp;show_byline=0&amp;amp;show_portrait=0&amp;amp;color=00ADEF&amp;amp;fullscreen=0&amp;amp;autoplay=1&amp;amp;loop=0" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="648" height="356"&gt;&lt;/embed&gt;&lt;/object&gt;
  &lt;?php } else { ?&gt;
  &lt;a href="&lt;?php echo $slide_6_url; ?&gt;" rel="bookmark"&gt;&lt;img src="&lt;?php echo $slide_6_image; ?&gt;" width="648" height="356" alt="thumb" /&gt;&lt;/a&gt;
  &lt;?php } ?&gt;&lt;/div&gt;
  &lt;div class="left2slider"&gt;
           &lt;h4&gt;&lt;?php echo $slide_6_title; ?&gt;&lt;/h4&gt;
           &lt;p&gt;
           &lt;?php print nl2br($slide_6_text); ?&gt;
              &lt;br&gt;
              &lt;a href="&lt;?php echo $slide_6_url; ?&gt;" class="readmore"&gt;Read More&lt;/a&gt;
          &lt;/p&gt;
           &lt;/div&gt;
              &lt;/li&gt;
              &lt;?php } // END OF SLIDER ?&gt;
  
  &lt;/ul&gt; 
  </code></pre>
  
  <p><strong>Does anyone know how to do this?  Thanks for your help!</strong>  Oh, and by the way, all of this code is located within the header.php file.</p>