0

Trying to add a new feed with:

function events_feed() {
include(TEMPLATEPATH . '/events.php/');
}
add_feed('gpevent','events_feed');

And I'm getting a failed to open stream directory not found error.

1.events.php lives in the root of my theme folder.

2.I added the function to my functions.php file. Saved & uploaded.

3.Resaved permalinks.

4.Visited http://example.com/feed/gpevents

1 Answer 1

1

Remove the last / in

include(TEMPLATEPATH . '/events.php/');

If you cannot find a file, check with file_exists( $path ) first.

Also TEMPLATEPATH is deprecated now, use get_stylesheet_directory() instead.

And your feed is located at /gpevent', not/gpevents' as Stephen Harris noted.

2
  • 1
    Looks like a missing 's' from gpevent too Commented Apr 19, 2012 at 18:31
  • Oddly, it passes file_exists() but yet I still get a open stream directory not found error. The feed adress was merely a typo on my behalf. It all works fine locally. I'm baffled. Commented Apr 20, 2012 at 15:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.