• Hello,

    I have written a class and saved it in its own file inside my theme folder (using the BlankSlate theme). I want to include the class in such a way that it is available in every single file for the theme (such as “sidebar.php”, “header.php”, etc), but using “require_once()” inside the “index.php” file does not work.

    How do I do this?

    Currently I have used the “require_once()” function in “header.php”, but when I want to reference a member function inside the “sidebar.php” file I get an error telling me I’m calling a member function of a non-object. In other words the class is not available inside the “sidebar.php” file.

    How can I achieve this?

    George

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘Make custom class available everywhere?’ is closed to new replies.