Advertisement
kobial8

Custom post Snippets

Feb 12th, 2015
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.94 KB | None | 0 0
  1. <?php
  2. function slider_custom_post() {
  3.  
  4. register_post_type( 'slider-items',
  5.     array(
  6.         'labels' => array(
  7.             'name' => __( 'Sliders' ),
  8.             'singular_name' => __( 'Slider' )
  9.             ),
  10.         'public' => true,
  11.         'menu_icon' => 'dashicons-format-status',
  12.         'supports' => array('title', 'editor', 'custom-fields', 'comments', 'thumbnail'),
  13.         'taxonomies' => array('post_tag', 'category'),
  14.         'has_archive' => true,
  15.         'rewrite' => array('slug' => 'slider-item'),
  16.         )
  17.     );
  18. register_post_type( 'testimonial',
  19.     array(
  20.         'labels' => array(
  21.             'name' => __( 'Testimonials' ),
  22.             'singular_name' => __( 'Testimonial' )
  23.             ),
  24.         'public' => true,
  25.         'menu_icon' => 'dashicons-format-status',
  26.         'supports' => array('title', 'editor', 'custom-fields','comments', 'thumbnail'),
  27.         'taxonomies' => array('post_tag', 'category'),
  28.         'has_archive' => true,
  29.         'rewrite' => array('slug' => 'testimonial'),
  30.         )
  31.     ); 
  32. }
  33. add_action( 'init', 'slider_custom_post' );
  34.  
  35. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement