Create a new Page or Post Programmatically in WordPress

Posted by Prem Tiwari | Updated on | in WordPress, WordPress Beginners, WordPress Snippets.


If you want to create some demo pages OR Posts during your custom wordpress theme installation, then you can use the wp_insert_post() function inside your functions.php file. Open functions.php file of your theme’s folder and …