Somehow despite having been developing web sites since the late 90's I'm only now working on my first WordPress site. And I'm having a bit of trouble understanding the organization of WordPress and where the right places are for me to add my own PHP code.
For example, I need to add some configuration info for a third party service that I'll be integrating with. This includes an API key that will be sent via JS at one point, then via PHP at another. Were this ASP.NET, I'd be adding the needed config info to the web.config XML file, then modifying a page to emit that info back out to the browser (as JS) while adding a server side handler that accesses the same.
So with WordPress...
- Where would I store this custom config info? Is there a standard configuration spot, or do I need to roll my own?
- How would I access this from within the Page content? Pages, as I understand them, use a predefined theme and store their actual content in the database, so I'm not sure how to inject that code back into the HTML.
- Shortcodes look promising, but everything I've read online says the appropriate spot to register them is in functions.php in your theme. Doesn't that mean that if we change our theme, the custom code would disappear? Is there a layer above "theme" for things that are more global in nature?