Advertisement
zaydB

Functions.php

Sep 14th, 2015
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.07 KB | None | 0 0
  1. function create_post_type() {
  2.   register_post_type( 'news_article',
  3.     array(
  4.       'labels' => array(
  5.         'name' => __( 'News' ),
  6.         'singular_name' => __( 'Article' ),
  7.        
  8.       ),
  9. 'taxonomies' => array('category','post_tag'),    
  10.       'public' => true,
  11.       'has_archive' => true,
  12.       'rewrite' => array('slug' => 'news_article'),
  13.       'supports' => array('thumbnail', 'editor','title', 'excerpt', 'editor', 'author', 'thumbnail',
  14.                                       'comments', 'revisions', 'custom-fields',),
  15.     )
  16.      
  17.   );
  18.    
  19.     register_post_type( 'events',
  20.     array(
  21.       'labels' => array(
  22.         'name' => __( 'Events' ),
  23.         'singular_name' => __( 'Event' ),
  24.        
  25.       ),
  26. 'taxonomies' => array('category','post_tag'),  
  27.       'public' => true,
  28.       'has_archive' => true,
  29.       'rewrite' => array('slug' => 'events'),
  30.       'supports' => array('thumbnail', 'editor','title', 'editor', 'excerpt', 'author', 'thumbnail',
  31.                                       'comments', 'revisions', 'custom-fields',),
  32.     )
  33.   );
  34.  
  35.   register_post_type( 'videos',
  36.     array(
  37.       'labels' => array(
  38.         'name' => __( 'Videos' ),
  39.         'singular_name' => __( 'Video' ),
  40.        
  41.       ),
  42. 'taxonomies' => array('category','post_tag'),    
  43.       'public' => true,
  44.       'has_archive' => true,
  45.       'rewrite' => array('slug' => 'videos'),
  46.       'supports' => array('thumbnail', 'editor','title', 'editor', 'excerpt', 'author', 'thumbnail',
  47.                                       'comments', 'revisions', 'custom-fields',),
  48.     )
  49.   );
  50.  
  51.   register_post_type( 'products',
  52.     array(
  53.       'labels' => array(
  54.         'name' => __( 'Products' ),
  55.         'singular_name' => __( 'Product' ),
  56.        
  57.       ),
  58. 'taxonomies' => array('category','post_tag'),    
  59.       'public' => true,
  60.       'has_archive' => true,
  61.       'rewrite' => array('slug' => 'products'),
  62.       'supports' => array('thumbnail', 'editor','title', 'editor', 'excerpt', 'author', 'thumbnail',
  63.                                       'comments', 'revisions', 'custom-fields',),
  64.     )
  65.   );
  66.  
  67.   register_post_type( 'sponsors',
  68.     array(
  69.       'labels' => array(
  70.         'name' => __( 'Sponsors' ),
  71.         'singular_name' => __( 'Sponsor' ),
  72.        
  73.       ),
  74.       'taxonomies' => array('category','post_tag'),  
  75.       'public' => true,
  76.       'has_archive' => true,
  77.       'rewrite' => array('slug' => 'sponsors'),
  78.       'supports' => array('thumbnail', 'editor','title', 'editor', 'excerpt', 'author', 'thumbnail',
  79.                                       'comments', 'revisions', 'custom-fields',),
  80.     )
  81.   );
  82.  
  83.     register_post_type( 'projects',
  84.     array(
  85.       'labels' => array(
  86.         'name' => __( 'Projects' ),
  87.         'singular_name' => __( 'Project' ),
  88.        
  89.       ),
  90. 'taxonomies' => array('category','post_tag'),  
  91.       'public' => true,
  92.       'has_archive' => true,
  93.       'rewrite' => array('slug' => 'projects'),
  94.       'supports' => array('thumbnail', 'editor','title', 'editor', 'excerpt', 'author', 'thumbnail',
  95.                                       'comments', 'revisions', 'custom-fields',),
  96.     )
  97.   );
  98.  
  99.   register_post_type( 'opinions',
  100.     array(
  101.       'labels' => array(
  102.         'name' => __( 'Opinions' ),
  103.         'singular_name' => __( 'Opinion' ),
  104.        
  105.       ),
  106. 'taxonomies' => array('category','post_tag'),    
  107.       'public' => true,
  108.       'has_archive' => true,
  109.       'rewrite' => array('slug' => 'opinions'),
  110.       'supports' => array('thumbnail', 'editor','title', 'editor', 'excerpt', 'author', 'thumbnail',
  111.                                       'comments', 'revisions', 'custom-fields',),
  112.     )
  113.   );
  114.  
  115.   register_post_type( 'tenders',
  116.     array(
  117.       'labels' => array(
  118.         'name' => __( 'Tenders' ),
  119.         'singular_name' => __( 'Tender' ),
  120.        
  121.       ),
  122. 'taxonomies' => array('category','post_tag'),    
  123.       'public' => true,
  124.       'has_archive' => true,
  125.       'rewrite' => array('slug' => 'tenders'),
  126.       'supports' => array('thumbnail', 'editor','title', 'editor', 'excerpt', 'author', 'thumbnail',
  127.                                       'comments', 'revisions', 'custom-fields',),
  128.     )
  129.   );
  130.     flush_rewrite_rules();
  131.   }
  132.   add_action( 'init', 'create_post_type' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement