• hello everyone,

    i am newbie in wordpress and i am trying to develop my own plugin for my own contact us page.

    i have created plugin and i can see it in my plugin list also and i am able to do active and deactivate also.

    i am creating new table when plugin gets activated and i am droping it when plugin deactivate. everything is going perfect.

    now i want to create new page with my contact us template through plugin and i want to add some html code inside it when plugin activates…

    i am wondering how i can do it through plugin? is it possible? or how to achieve it?

    Thanks in advance…

Viewing 1 replies (of 1 total)
  • Thread Starter kalpitpandit

    (@kalpitpandit)

    function createPage()
    {
        global $user_ID;
        $page['post_type']    = 'page';
        $page['post_content'] = 'hello this page created by plugin';
        $page['post_parent']  = 0;
        $page['post_author']  = $user_ID;
        $page['post_status']  = 'publish';
        $page['post_title']   = 'Dynamic page';
        $pageid = wp_insert_post ($page);
    }

    now i am able to create new page by using above code. but i want to assign specific template to it… can anybody suggest it?

Viewing 1 replies (of 1 total)
  • The topic ‘How to create page’ is closed to new replies.