Add Post Custom type

 <?php


add_action( 'wp_ajax_nopriv_action_job_apply', 'uouApplyItem' );

add_action( 'wp_ajax_action_job_apply', 'uouApplyItem' );



// Add New Post Type For job

function omega_job_posttype() {

global $shortname;

register_post_type( 'job',

array(

'labels' => array(

'name' => __( 'Job', 'omega'),

'singular_name' => __( 'Job', 'omega'),

'add_new' => __( 'Add New Job', 'omega'),

'add_new_item' => __( 'Add New Job', 'omega'),

'edit_item' => __( 'Edit Job', 'omega'),

'new_item' => __( 'Add New Job', 'omega'),

'view_item' => __( 'View Job', 'omega'),

'search_items' => __( 'Search Job',  'omega'),

'not_found' => __( 'No Job found',  'omega'),

'not_found_in_trash' => __( 'No job found in trash', 'omega')

),

'public' => true,

'supports' => array( 'title', 'editor', 'thumbnail', 'comments'),

'taxonomies' => array('job_category'),

'capability_type' => 'post',

'rewrite' => array("slug" => "job"),

                'menu_icon' => get_template_directory_uri().'/skl/framework/img/job.png',

                'menu_position' => 29

)

);

// Add job Categories

register_taxonomy('job_category', 'job', 

array(

'labels' => array(

'name' => _x( 'Categories', $shortname),

'singular_name' => _x( 'Category', $shortname),

'search_items' =>  __( 'Search Job Categories', 'omega'),

'all_items' => __( 'All Job Categories', 'omega'),

'edit_item' => __( 'Edit Job Category', 'omega'),

'update_item' => __( 'Update Category', 'omega'),

'add_new_item' => __( 'Add New Job Category', 'omega'),

'new_item_name' => __( 'New Job Category Name', 'omega'),

'menu_name' => __( 'Categories', 'omega'),

  ),

'hierarchical' => true,

'show_ui' => true,

'rewrite' => array( 'slug' => 'job_category' )

));

}


add_action('init', 'omega_job_posttype');


// Set as many image sizes as you want

add_filter("manage_edit-job_columns", "job_edit_columns");

add_action("manage_posts_custom_column",  "job_columns_display", 10, 2);

?>

Comments

Popular posts from this blog

Get Post Data From Simple Post custom shortcode

Top 20 Beautiful Pen For Writing

Fatal error: Maximum execution time of 300 seconds exceeded in C:\xampp\phpMyAdmin\libraries\classes\Dbi\DbiMysqli.php on line 199