badget

Biggest Sale! Special Offer!

Get 30% discount on all of our single themes with this coupon code: #30%SALE

Hurry up! *Limited time offer*

alexmarcxyz

Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
    Posts
  • alexmarcxyz
    Blocked

    Go to function.php file from your theme directory and then add this code to it:

    /* Custom Post Type Start */

    function create_posttype() {
    register_post_type( ‘news’,
    // CPT Options

    array(
    ‘labels’ => array(
    ‘name’ => __( ‘news’ ),
    ‘singular_name’ => __( ‘News’ )
    ),
    ‘public’ => true,
    ‘has_archive’ => false,
    ‘rewrite’ => array(‘slug’ => ‘news’),
    )
    );
    }
    // Hooking up our function to theme setup
    add_action( ‘init’, ‘create_posttype’ );

    /* Custom Post Type End */

    Once this code will be added, you will see the new post added into the dashboard, for creating custom post type WordPress you can follow this guide, it has all 3 types of posts tutorials.

Viewing 1 post (of 1 total)