I have created a function called generate_rss(), but when I call that function inside a page using PHP code as input format, I get the following error message:

Fatal error: Call to undefined function generate_rss().

I am using Drupal 6. Does anybody know how to fix this?

     echo generate_rss('http://rss feed url here');

I think template.php is loaded after the page's contents are rendered. If I use

`include_once( 'path to theme/template.php');` 

there will be no fatal error.

  • 1
    Clear your cache. drupal.org/node/337176, make sure the theme containing the generate_rss function is active. – niksmac Mar 14 '13 at 10:25
  • @NikhilM I tried that, but no change – user7282 Mar 14 '13 at 12:15
  • please post your code – Andrew Welch Mar 14 '13 at 12:23
  • @AndrewWelch I pasted code – user7282 Mar 14 '13 at 12:31

Your Answer

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

Browse other questions tagged or ask your own question.