PHP: WordPress Test Page

The problem!

I have a WordPress site up and running. I wanted to add a custom page, for example if I browse to site.com/mytest it would display just Hello world without any css etc.

What I’ve tried

I added a mytest.php file under var/www/wp-content/ and tried to browse to it. (The code simply echo a static text).

Read More

What I got was simply a 404 page by WordPress.

Related posts

2 comments

  1. To view the file you uploaded, browse: site.com/wp-content/mytest.php

    If you just type site.com/mytest , wordpress will thin you are reffering to a page stored in the wp-database. Since it’s not you cant view it.

    To add the page in the menu, use custom menu and add as “Custom link”.

  2. You can make your page a wp custom page template by adding this at the top:

    /*
    Template Name:Your Page Name
    */
    

    Then create a page in the wordpress dashboard pages and select your page template from the page template dropdown.

Comments are closed.