Creating custom post type in wordpress

Mahabubur Rahman
3



You can create a custom post type in WordPress. For this, you can use the function.php file that already exists in your theme folder or you can write it on your theme default plugin file or you can create a new plugin to create a custom post type. The function to create a custom post type is following -


function create_custom_posttype() {
    register_post_type( 'tutorial',
    // CPT Options
        array(
            'labels' => array(
                'name' => __( 'Tutorial' ),
                'singular_name' => __( 'Tutorial' )
            ),
            'public' => true,
            'has_archive' => true,
   'taxonomies' => array('category','post_tag'),//add category and tag
            'rewrite' => array('slug' => 'tutorial'),
        )
    );
}

add_action( 'init', 'create_custom_posttype' );

Here we create a custom post type named Tutorial.  


Post a Comment

3Comments
  1. Anda pecinta Judi Online??, ingin mendapatkan kemenangan yang besar dengan modal 25rb saja??, dan ingin mendapatkan jackpot serta bonus yang besar setiap harinya??, maka daftarkan diri anda disalah satu situs judi online yang sudah terpercaya di Indonesia.

    1 mandiridomino.net
    2. qqkompas.net
    3. dadudomino.com
    4. dewadominoqq.net
    5. dewajudiqq.net
    6. vipmandiriqq.net
    7. bandarjudiqq.org
    8. pemainbandarq,info

    Untuk semua situs judi online di atas menawarkan permainan DominoQQ, BandarQ, Poker Online, Capsa Susun, Bandar Poker, Sakong Online

    Dan jika anda ingin melakukan permainan Judi Casino, Judi Togel dan Judi Bola, maka bisa mengunjungi website dibawah ini.

    1. indototo88.net
    2. mastercasino88.com

    ReplyDelete
Post a Comment