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 3rd 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 libs I need I have no other dependencies in the PHP code I want to include in a WP page. So obviously any solution that didn’t require learning the WP api would be the best one.please help me to slove this problem.
Please refer to the Page Templates section of the Static Pages Codex entry.
Essentially, you create a custom page template, named something like
template-foobar.php
, which will live in your Theme’s root directory, or in a one-deep sub-directory.Inside this template file, add the following:
Now your template is available to be assigned to any static Page you create.
Create a custom page template, and add your code there. There is also an older article by Justin Tadlock about that topic.
Basically, you copy the
page.php
orsingle.php
of your theme, add a header to it â¦â¦ and your code.
In the back-end you select that template for the page you want to create.