Custom php page in WordPress theme?

For example I have in my theme folder named test-pages with some php web pages that display different message, in some part of process I want to pull with file_get_contents to get content of one page from that folder, but I can’t do it, it just doesn’t work, when I try to access directly to that page, I get 404 message like that pages doesn’t exists.

How can I make this page visible to WordPress, so I can access it without getting 404?

Read More

Hope you understand me.

Related posts

Leave a Reply

2 comments

  1. The solution is here.

    Simply go into the page template you want to edit and add this at the very top:

    <?php
        /*
        Template Name: Your template name goes here
        */
    ?>
    

    When you go into the admin area and edit the page you want, a dropdown list of page templates will appear in the right column that you can choose from.

    Edit: If you have already done what I described above, and the problem persists, you might have a .htaccess issue. Another possibility is that you aren’t referencing the file correctly, so double check your declarations to make sure they are producing the correct file path and file name. Hope this helps you out!