How to add a php custom page to WordPress

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)

Read More

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.

Related posts

Leave a Reply

2 comments

  1. 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:

    <?php
    /**
     * Template Name: Foobar
     */
    
    get_header();
    
    // YOUR CUSTOM PHP GOES HERE
    
    get_footer();
    ?>
    

    Now your template is available to be assigned to any static Page you create.