I have created an XML files that use the same database as WordPress but largely non-WordPress content. I have had these XML files work as RSS feeds on an external domain, but would like to bring this inside of WordPress.

I've created 4 custom feed-name.php templates, include my code and added them to WordPress with the filters etc. they currently return no content because I am unable to access WordPress's functions or my classes in my mu-plugins.

My code includes include('./wp-load.php'); which should allow access to WordPress's functions and my own, but this isn't working.

Have i missed something?

note: including get_header(); breaks the page because it includes loads of html that doesn't validate as xml.

p.s. no custom-template tag?

  • should note that the 1 mu-plugin is a class that generates the xml code another is a db access layer that uses the defined host/user/pass from the wp-config. + nothing in my error_log – Mat Benfield Oct 6 '14 at 20:00

turns out a minor typo in a method call within a method in the class was causing some confusion.

feeds have to be added to the init action too

  1. function to create feeds
  2. function to add actions
  3. function to init actions function


| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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