PurabTech is technical blog for Programmer and Coders
programmatically create wordpress page using theme code
Many times client want predefined page in wordpress site when theme is activated. Here in this wordpress tutorial, we will show you how to programmatically create page or posts in wordpress website.
programmatically create wordpress page
If you want to create custom page with content than you can use following code. You just need to open “functions.php” file. (File can be found in theme folder).
You just need to copy and paste above code into functions.php file. This will create custom page in wordpress website. programmatically created page will look like as follows:
programmatically create wordpress page
programmatically create wordpress post
If you want to create wordpress post programmatically than use following code.