title: Warning: array_slice() expects parameter 1 to be array, null given in
body: <p>I'm using the following code in my WordPress site to display the latest Youtube video from my account using rss: </p>
  
  <pre><code>&lt;?php
  include_once(ABSPATH.WPINC.'/rss.php'); // path to include script
  $feed = fetch_rss('http://gdata.youtube.com/feeds/api/users/UrbanGAME/uploads'); // specify feed url
  $items = array_slice($feed-&gt;items, 0, 1); // specify first and last item
  ?&gt;
  
  &lt;?php if (!empty($items)) : ?&gt;
  &lt;?php foreach ($items as $item) : ?&gt;
  
  &lt;object width="96%"&gt;&lt;param name="movie" value="&lt;?php echo str_replace("watch?v=","v/", $item['link']); ?&gt;&amp;hl=en_GB&amp;fs=1&amp;"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="&lt;?php echo str_replace("watch?v=","v/", $item['link']); ?&gt;&amp;hl=en_GB&amp;fs=1&amp;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="96%"&gt;&lt;/embed&gt;&lt;/object&gt;
  
  &lt;?php endforeach; ?&gt;
  &lt;?php endif; ?&gt;
  </code></pre>
  
  <p>It works. However, some of the times I get this error when it does not work: </p>
  
  <pre><code> Warning: array_slice() expects parameter 1 to be array, null given in /wp-content/themes/theme1/header.php  on line 173. 
  </code></pre>
  
  <p>Also I'm using the above code twice, for 2 spots on the site for 2 different accounts. One is in the my header.php file and the other in my footer.php file. When 1 works, the other does not, and of course I get an error/warning for the other one as well, just referring to that file and a different line. I have tried messing with the code and still nothing. Could the problem be with something in my code?</p>
  
  <p>Additional info:</p>
  
  <p>php: 5.3.2</p>
  
  <p>host: crazy domains (<a href="http://www.crazydomains.com.au/" rel="nofollow">http://www.crazydomains.com.au/</a>)</p>
  
  <p>apache: 2.2.15</p>