• Hi guys.

    I’m about to create a plugin which would show me a custom page generated from the content I put in the database through the admin page.

    The concept should be easy to understand. I would like to create 3 ‘custom’ pages using the same ‘template’. Lets say for example I’ve created the admin page. I’ve made 3 pages, I’ve added all stuff I wanted to. Every page has it own ID. I want to access it by url like this: http://www.example.com/myplugin.php?id=2.

    Actually I have no idea how to that…

    I thought I could create a page and and short code that contains ID of the certain page. However this would be too much work because I want to have about 50-60 pages like this.

    Any ideas?

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    You can create pages by script with wp_insert_post(). A page is just a certain type of post. You would access it with example.com/index.php?p=2 assuming that 2 is the post ID. You could use your own php page to display the WP page, but why? You can use the rewrite api if the url parameter must be id instead of p.

    The one difference from inserting a regular post is you would specify the page template with update_post_meta() under the key ‘_wp_page_template’.

Viewing 1 replies (of 1 total)

The topic ‘'custom' page created by plugin.’ is closed to new replies.