php External function call not working

I’m not sure if this question will require some code examples, but…

Here’s the situation:

I am working on a site that someone else has already done work on.
I am trying to call an external function located in a file, let’s aay, ‘myFunctions.php’.
The previous person has function calls to this file in the main web page with no problem.
I created a new short function and placed it in that same file.
The web page already has a ‘require_once(“myfunctions.php”);’ line.
The web site is in WordPress, though a highly customized site.
The new function works fine when placed in the page, however I would like to use it on more than one page.

How can I get the new function to work? Does it have something to do with WordPress?

It seems strange to me because the other functions that were already in the file work with no problem.

Thank you.

Next test:

It seems the problem is in the calling somehow.

I simplified the code in order to test this. Here is the code I have now:

$user = getUserInfo($username);
$myTest = strTest();

echo $myTest;

And in the external functions file funct.php:


function strTest(){
   return "This test worked!";


The above function “getUserInfo” is a older one that also resides in the funct.php and works just fine.

However, the new function “strTest”, when called does not work and the page is blank from that line on.


Found it!

Sorry to everyone who contributed, but it looks like it was just a stupid oversight. I had just realized that the other guy had the functions containing file in another folder. There was a copy of it in the folder I was working with, but the actual ‘include’ statement referred to the other folder.

As with many problems I’ve had before, when the results seem very strange, the problem is usually syntax or address errors.


Leave a Reply


Hire Me
Follow Me!
Most Popular Articles & Pages
Because your vote is Important
Sorry, there are no polls available at the moment.