Support » Fixing WordPress » Create a placeholder page for a plugin

  • Hi all, I need some help.
    I’m coding my own plugin, and I have this problem.
    I’d like to create a placeholder page where the plugin can display the result in the frontend.
    Unfortunatelly I don’t know how to code it!

    Anyone could help me please?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Michael


    Forum Moderator

    look into the codex, under page template:

    read this first, or again if you have read it already:

    make a copy of index.php and call it ‘my-page-template.php’ for instance.
    edit it and put this code into the top:

    Template Name: My Page Template for plugin

    save it.

    in ‘admin’ – ‘pages’ – ‘add new’: make a new page with the title ‘Placeholder’ – or whatever; the content does not matter, you may want to put a note into it, that this page is a placeholder with a diferent page tmeplate – it will not be shown anyway.

    on the right under ‘attributes’ ‘template’ click the drop down menu and select ‘My Page Template for plugin’.

    save and publish the page.

    edit the ‘my-page-template.php’ and put your plugin code into it or whatever.

    you should be able see your new page under the pages lists.

    Ok but in this way I have to put the ‘my-page-template.php’ into the template directory, am I right?
    There’s a way to have all in the plugin Directory?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Create a placeholder page for a plugin’ is closed to new replies.