Forum Moderators: coopster
I wonder if you can help we use simplepie to add rss feeds via include files to our wordpress blog posts.
This all works very well on single posts, until you have a category where you may have 3 posts all with php include files.
So you you may have say a Category canaries deals, with a post called canaries with a php include file and say a thomson holidays post also with an include file, both different include files but both calling this
<?php
require 'deals/simplepie.inc'; so you get the fatal error "cannot redeclare class"
I was thinking perhaps a php "if" command but cannot figure it out for the life of me.
I have been toying with this but cannot figuire it out,
// Include the required SimplePie library.
if(!class_exists("SimplePie"))
{
require_once $simplepiefile;
}
Many thanks for reading
Peter
Yes changed all the require to require once as in previous post but error is still there, on single post its not a problem its category post that cause the problem where you have 3 or 4 post all calling for simplepie.
As before you lost the sidebars now you get the sidebars back but if you have say 3 posts only one will now show the error if that make sense.