• I know how to add content both pages and post to wordpress so don’t misunderstand me, however when creating a new template how do I ‘register’ a new php page in wordpress?

    So I want to add a page called ‘hello_world.php’ into my template, to keep it all simple lets not worry for why. The problem i have is how do tell wordpress that when i go to ‘www.example.com/wordpress/hello_world’ it should go to ‘www.example.com/wordpress/wp-content/themes/my_theme/hello_world.php’?

    I am a php developer so no need to worry about making me cry 🙂

    Jason

Viewing 2 replies - 1 through 2 (of 2 total)
  • You need to create a new template and apply that template to a page called hello_world

    at the very top of the template page add this

    <?php
    /**
    * Template Name: Whatever you want to name it
    */
    ?>

    rest of your script goes bellow

    then create a page in wordpess and apply this template

    Also you can name your template page whatever you want so in your case it could be hello_world.php just make sure it is in the theme you are using.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘adding hello_world.php to a template’ is closed to new replies.