We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25855
    • 2 Posts
    Hi

    I’m a newby with ModX and work on using the this tutorial for integrating a menu
    in the header from Wordpress. For that I have a php file in the folder wp/wp-content/themes/default/

    If I call the php file directly the menu will shown, but with an include in the header.php of wordpress it want work. I get only:

    Could not load DBAPI class.

    With debugging I found out, that all variables for the db are empty although they are initialised in the config and are accessible in the modxapi.php. Sorry for my terriblly
    english and thanks for helping. smiley
      • 25855
      • 2 Posts
      Hi

      To the modxAPI or to the DBAPI?
      My Test.php allready use an absolute path to include the modxapi.php.
      And with a direct call of this Test.php it works! The Test.php is in the
      directory of the default Wordpress theme. Only with including the
      Test.php into the header.php from wp it stop working.
        • 22303 MODX Staff
        • 10,725 Posts
        I don’t think that’s gonna work. The paths are determined based on some very specific assumptions at the moment, that would not be true when running this in some other location. Unfortunately, I’ve never looked at the ModXAPI add-on being used here to try this. You’ll likely need to just go ahead and hardcode all the paths/defines in config.inc.php to use this with any success.