I want to create a custom page for my WordPress blog that will execute my PHP code in it, whilst remaining a part of the overall site CSS/theme/design.
The PHP code will make use of third-party APIs (so I need to include other PHP files).
How do I accomplish this?
N.B.: I do not have a specific need to interact with the WordPress API – apart from including certain other PHP libraries, I need I have no other dependencies in the PHP code I want to include in a WordPress page. So obviously any solution that didn’t require learning the WordPress API would be the best one.
If you don\’t need to interact with the API or use a plugin. First, copy / duplicate post.php (under 3/wp-content/thememename/). Rename the new file as templatename. PHP (where you want to call your new template) to the list of available templates, enter the following at the top of the file: ?php/* Template Name: Name of Template */ .\n\nThis file (in PHP) can add other files or whatever you need. Then create a new page in your WordPress blog, and in the page editing screen you\’ll see an Attributes widget (a Template dropdown to the right) and publish this page. Your new site will use the PHP code defined in templatename.php Source: Creating Custom Page Templates for Global Use.