I am creating a plugin in wordpress.
I am unable to find a way to create a new wordpress page using plugin.
I want to make a new page on the front end of the wordpress when the user activates the plugin.
4 comments
Comments are closed.
I am creating a plugin in wordpress.
I am unable to find a way to create a new wordpress page using plugin.
I want to make a new page on the front end of the wordpress when the user activates the plugin.
Comments are closed.
With the help of above code, you can create dynamic page.
Firstly we need to check if the post we are going to create is available or not.
If present you dont need to create another one you can edit the content of the
page. But if you changed the title of the page new page will be created.
Here I have created a page with the help of title of the page.
Something like this
See here for other possible params.
A convenient helper function to create a bunch of pages:
This way you can add page
For detail see this https://codex.wordpress.org/Function_Reference/wp_insert_post