I write this code

function get_feed(){

 // Get RSS Feed(s)
include_once(ABSPATH . WPINC . '/rss.php');
$rss = fetch_rss('http://dorar.shamekh.ws/?feed=rss2');
$maxitems = 1;
$items = array_slice($rss->items, 0, $maxitems,false);
return $items;

}

ass part of wordpress plugin for wordpress , its work fine during my local server , however when I upload it to my blog I recieve the content

Warning: array_slice() [function.array-slice]: The very first argument ought to be an assortment in

php version during my local host : 5.2.6 php version during my site : 5.2.5

It appears in the documentation that $rss->items should be an assortment. I'd reckon that the RSS fetch is failing. Try:

if (is_array($rss->items)) {
  $items = array_slice($rss->items, 0, $maxitems,false);
} else { var_dump($rss->items); }
MagpieRSS coupled with dorar.shamekh.ws' (utilization ofOrsettings of) Apache 1.3.41 is resulting in a really bizarre behavior: A "normal" HTTP request:

GET /feed/ HTTP/1.

Host: dorar.shamekh.ws

MagpieRSS's request:


GET /feed/ HTTP/1.

User-Agent: MagpieRSS/.72 (+http://magpierss.sf.internet)

Host: dorar.shamekh.ws:80

Accept: image/presen, image/x-xbitmap, image/jpeg, image/pjpeg, */*

Note the various 'Host' headers. Once the port number is appended, as with MagpieRSS, the website returns a 301:


HTTP/1.1 301 Moved Permanently

Date: Comes to an end, 22 May 2009 02:45:03 GMT

Server: Apache/1.3.41 (Unix) PHP/5.2.5 mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 FrontPage/5..2.2635 mod_ssl/2.8.31 OpenSSL/.9.7a

X-Powered-By: PHP/5.2.5

X-Pingback: http://dorar.shamekh.ws/xmlrpc.php

Last-Modified: Get married, 20 May 2009 22:03:05 GMT

ETag: "e591693fdf2d27ee7dae19e256db2f46"

Location: http://dorar.shamekh.ws/feed/

Connection: close

Content-Type: text/html

How about casting $rss->items being an array first:

function get_feed(){

 // Get RSS Feed(s)
include_once(ABSPATH . WPINC . '/rss.php');
$rss = fetch_rss('http://dorar.shamekh.ws/?feed=rss2');
$maxitems = 1;
$rss->items = (array) $rss->items;
$items = array_slice($rss->items, 0, $maxitems,false);
return $items;

}

It may sound prefer to me that when it's trying to obtain the RSS it's failing. Possibly fetch_rss uses file_get_contents that has been disabled for Web addresses.

Either that, or for whatever reason, the home $rss->items is not an assortment for whatever reason.

fetch_rss() it's deprecated. See: http://codex.wordpress.org/Function_Reference/fetch_rss

You have to use fetch_feed()