Create a new Page or Post Programmatically in WordPress

By Prem Tiwari in WordPress, WordPress Beginners, WordPress Snippets. Updated on


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 …