Custom Post Types In WordPress

In the first installment of WordPress Theme Development, we’ll be taking a look at implementing custom post types in your theme, along with custom taxonomies.

Curabitur blandit tempus porttitor. Nulla vitae elit libero, a pharetra augue. Nulla vitae elit libero, a pharetra augue. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.

Donec id elit non mi porta gravida at eget metus. Vestibulum id ligula porta felis euismod semper. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Nulla vitae elit libero, a pharetra augue. Donec sed odio dui. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Nullam id dolor id nibh ultricies vehicula ut id elit. Nullam id dolor id nibh ultricies vehicula ut id elit. Donec sed odio dui. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Nullam quis risus eget urna mollis ornare vel eu leo. Nullam id dolor id nibh ultricies vehicula ut id elit. Nullam id dolor id nibh ultricies vehicula ut id elit.

Creating Your First Custom Post Type

Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Etiam porta sem malesuada magna mollis euismod. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Nullam id dolor id nibh ultricies vehicula ut id elit. Nulla vitae elit libero, a pharetra augue.

function dwp_apps() {
      $args = array(
           'labels' => array(
           'name' => __( 'Applications', 'dwp_launch' ),
           'singular_name' => __( 'Application', 'dwp_launch' ),
           'add_new' => __( 'Add New Application', 'dwp_launch' ),
           'add_new_item' => __( 'Add New Application', 'dwp_launch' ),
           'edit_item' => __( 'Edit Application', 'dwp_launch' ),
           'new_item' => __( 'New Application', 'dwp_launch' ),
           'view_item' => __( 'View App', 'dwp_launch' ),
           'search_items' => __( 'Search Applications', 'dwp_launch' ),
           'not_found' => __( 'No Applications Found', 'dwp_launch' ),
           'not_found_in_trash' => __( 'No applications found in the trash', 'dwp_launch' ),
      ),

      'public' => true,
      'publicly_queryable' => true,
      'show_ui' => true,
      'exclude_from_search' => true,
      'menu_position' => 5,
      'capability_type' => 'post',
      'hierarchical' => true,
      'rewrite' => array( 'slug' => 'apps' ),
      'query_var' => true,
      'supports' => array( 'title', 'editor' )
 );

 register_post_type( 'dwp_apps' , $args );
 }

Leave a Comment