![]() |
|
Trying to use custom function in Wordpress - Printable Version +- ZenphotoCMS Forum (https://forum.zenphoto.org) +-- Forum: Support (https://forum.zenphoto.org/forum-1.html) +--- Forum: General support (https://forum.zenphoto.org/forum-4.html) +--- Thread: Trying to use custom function in Wordpress (/thread-6050.html) |
Trying to use custom function in Wordpress - bryanbrazil - 2009-10-28 I'm trying to use the following function, which is stored in my zp-customfunctions.php file, in my Wordpress Footer.
Quote:Fatal error: Call to undefined function prefix() in /home/bryan/public_html/wp-content/themes/valid-light/zp-customfunctions.php on line 300
Quote:Zenphoto Error "/" Wordpress is installed in the root Is it possible to hard-code the path for template-functions.php, like this:
It doesn't seem to work like this. Hopefully I've provided enough details...thanks in advance for any help you can provide. Trying to use custom function in Wordpress - bryanbrazil - 2009-10-28 Oh yeah, Wordpress and Zenphoto are installed in the same database. Trying to use custom function in Wordpress - sbillard - 2009-10-28 PHP includes/requires, etc. are on file system files, not URLs. Trying to use custom function in Wordpress - bryanbrazil - 2009-10-29 OK, so any idea why I get the Zenphoto Error when using the suggested require statement? Thanks! Trying to use custom function in Wordpress - sbillard - 2009-10-29 What is failing is the user/password, etc. information for the database connection. Not really sure why this would be so, though. Possible some other Wordpress user can jump in here and help. I have no experience with it. Trying to use custom function in Wordpress - acrylian - 2009-10-29 I just remembered this, was hard to find again (that is the disadvantage if no ticket is created...): http://www.zenphoto.org/support/topic.php?id=5723#post-33280 Trying to use custom function in Wordpress - bryanbrazil - 2009-10-29 Hmm, I tried making the change to functions-db.php suggested by natenewz, but I couldn't get it to work. It looks like the end of the code isn't displaying properly in his post. If I can test anything out, just let me know. Thanks! Trying to use custom function in Wordpress - acrylian - 2009-10-29 Besides that it is of course not recommended to hack core files, I guess you need to tell the script you posted at the beginning which mysql connection to use. Trying to use custom function in Wordpress - bryanbrazil - 2009-10-29 Don't worry, I backed up the file before modifying it and then restored the original when things didn't work. :-) I'm wondering if I have problems with multiple database connections because I use the Zenphoto Press plugin to display a random photo in my sidebar. Trying to use custom function in Wordpress - bryanbrazil - 2009-11-02 FYI -- I solved my problem by hardcoding the database prefixes and not using the prefix function. Still can't figure out why I can't require template-functions.php in my header, though. |