alihaag

functions.php - marty's custom post type gen

Jan 30th, 2015
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.52 KB | None | 0 0
  1. <?php
  2. add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
  3. function theme_enqueue_styles() {
  4.     wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
  5. }
  6.  
  7. <?php
  8. add_action("init", "register_credit_post_type");
  9. function register_credit_post_type() {
  10.   register_post_type( "Credits",
  11.         array(
  12.             "labels" => array(
  13.                 "name" => __( "Credits" ),
  14.                 "singular_name" => __( "Credit" ),
  15.                 "add_new" => __( "Add New" ),
  16.                 "add_new_item" => __( "Add New Credits" ),
  17.                 "edit" => __( "Edit" ),
  18.                 "edit_item" => __( "Edit Credits" ),
  19.                 "new_item" => __( "New Credits" ),
  20.                 "view" => __( "View Credits" ),
  21.                 "view_item" => __( "View Credits" ),
  22.                 "search_items" => __( "Search Credits" ),
  23.                 "not_found" => __( "No Credits Found" ),
  24.                 "not_found_in_trash" => __( "No Credits Found in trash" ),
  25.                 "parent" => __( "Credit" ),
  26.             ),
  27.   "public" => true,
  28.   "show_ui" => true,
  29.   "menu_position" => 5,
  30.   "has_archive" => true,
  31.   "publicly_queryable" => true,
  32.   "show_in_nav_menus" => true,
  33.   "rewrite" => array("slug"=>"credit"),
  34.   "supports" => array(
  35.       "title",
  36.       "editor",
  37.       "thumbnail",
  38.       "author",
  39.       "excerpt",
  40.       "trackbacks",
  41.       "custom_fields",
  42.       "comments",
  43.       "revisions",
  44.       "post_formats",
  45.       ),
  46.         )
  47.     );
  48. flush_rewrite_rules();
  49. }
  50. ?>
Advertisement
Add Comment
Please, Sign In to add comment