How to read configuration file in wordpress or PHP

You certainly could define those values as PHP constants and/or global variables in, for instance, functions.php.

I understand you would, at this point, rather go with a “file based approach” than using the database, but nonetheless, I have to mention that that would be both the standard as well as the best way of doing things.

Have a look at the WordPress Options API.

I haven’t quite understood whether you’re developing a plugin or a theme (you’ve tagged the question , but in the question itself you speak of your theme’s files).
At any rate, options would be the way to go.

Leave a Comment