Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

share|improve this question
add comment

1 Answer

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.

share|improve this answer
1  
Looks like a missing 's' from gpevent too –  Stephen Harris Apr 19 '12 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. –  Justin W Hall Apr 20 '12 at 15:33
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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