- This topic is empty.
Viewing 1 post (of 1 total)
-
AuthorPosts
-
October 25, 2011 at 6:21 am #34904RemesteMember
I’m trying to use simplepie within a wordpress template. I know there’s a simplepie plugin out there but i really want to get myself away from using plugins and try doing things myself.
Following Chris’ screencast on the subject, i’ve done the following:
1. Created two new directories in my wordpress theme folder, “cache” and “inc”.
2. Placed the simplepie.inc file into the “inc” folder.
3. Included the following at the top of my header.php file.
//get the simplepie library
require_once('inc/simplepie.inc');
//grab the feed
$feed = new SimplePie();
$feed->set_feed_url(array(
'http://feeds2.feedburner.com/CssTricks',
'http://smashingmagazine.com',
));
//enable caching
$feed->enable_cache(true);
//provide the caching folder
$feed->set_cache_location('cache');
//set the amount of seconds you want to cache the feed
$feed->set_cache_duration(1800);
//init the process
$feed->init();
//let simplepie handle the content type (atom, RSS...)
$feed->handle_content_type();
?>
4. Set the file permissions on the “cache” folder to 777 (tried 755 also)
Unfortunately these errors appear at the top of my page:
Warning: cache/5b60105eb4ce277db99d436af8b812b9.spc is not writeable in /nfs/c08/h01/mnt/120506/domains/mydomain.com/html/project/wp-content/themes/theme-tdt/inc/simplepie.inc on line 1773
Warning: cache/570cbd2a6f5e3c8d32b539d47fb9dc41.spc is not writeable in /nfs/c08/h01/mnt/120506/domains/mydomain.com/html/project/wp-content/themes/theme-tdt/inc/simplepie.inc on line 1668
Warning: cache/4f00777ba735f7a90601c8c02fadd110.spc is not writeable in /nfs/c08/h01/mnt/120506/domains/mydomain.com/html/project/wp-content/themes/theme-tdt/inc/simplepie.inc on line 1773
From looking at those errors i can’t work out if it’s a path error or a permissions error?
Any ideas?
-
AuthorPosts
Viewing 1 post (of 1 total)
- The forum ‘Back End’ is closed to new topics and replies.