Advertisement
lazab2011

custom post type

Jun 29th, 2014
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.81 KB | None | 0 0
  1. I keep getting this error message:
  2.  
  3. "
  4. Notice: Trying to get property of non-object in /server/file/location/themes/genesis/lib/functions/general.php on line 206<br/>
  5. Notice: Trying to get property of non-object in /server/file/location/themes/genesis/lib/functions/general.php on line 206<br/>
  6. Notice: Trying to get property of non-object in /server/file/location/themes/genesis/lib/functions/general.php on line 206<br/>
  7. Notice: Trying to get property of non-object in /server/file/location/themes/genesis/lib/functions/general.php on line 206<br/>
  8. Notice: Trying to get property of non-object in /server/file/location/themes/genesis/lib/functions/general.php on line 206<br/>
  9. "
  10. Here is the code that I used to make the post type
  11. `
  12. //Create Support Post Type
  13.  
  14. add_action('init', 'my_custom_register_my_cpt_support');
  15. function my_custom_register_my_cpt_support() {
  16. register_post_type('support', array(
  17. 'label' => 'Supports',
  18. 'description' => 'This is an my_custom support functionality',
  19. 'public' => true,
  20. 'show_ui' => true,
  21. 'show_in_menu' => true,
  22. 'capability_type' => 'post',
  23. 'map_meta_cap' => true,
  24. 'hierarchical' => false,
  25. 'rewrite' => array('slug' => 'support', 'with_front' => 1),
  26. 'query_var' => true,
  27. 'has_archive' => true,
  28. 'menu_position' => '50',
  29. 'menu_icon' => 'dashicons-hammer',
  30. 'supports' => array('title','editor','excerpt','comments','thumbnail','author','page-attributes','post-formats','genesis-cpt-archives-settings'),
  31. 'labels' => array (
  32. 'name' => 'Supports',
  33. 'singular_name' => 'Support',
  34. 'menu_name' => 'My Support',
  35. 'add_new' => 'Add New',
  36. 'add_new_item' => 'Add New Support',
  37. 'edit' => 'Edit',
  38. 'edit_item' => 'Edit Support',
  39. 'new_item' => 'New Support',
  40. 'view' => 'View Support',
  41. 'view_item' => 'View Support',
  42. 'search_items' => 'Search Support',
  43. 'not_found' => 'No Support Found',
  44. 'not_found_in_trash' => 'No Support found in Trash',
  45. 'parent' => 'Parent Support',
  46. )
  47. ) ); }
  48.  
  49. //Create Categories Taxonomy for Support
  50.  
  51. add_action('init', 'my_custom_register_my_taxes_support_category');
  52. function my_custom_register_my_taxes_support_category() {
  53. register_taxonomy( 'support_category',array (
  54. 0 => 'support',
  55. ),
  56. array( 'hierarchical' => true,
  57. 'label' => 'Categories',
  58. 'show_ui' => true,
  59. 'query_var' => true,
  60. 'show_admin_column' => true,
  61. 'labels' => array (
  62. 'search_items' => 'Category',
  63. 'popular_items' => 'Popular Categories',
  64. 'all_items' => 'All Categories',
  65. 'parent_item' => 'Parent Category',
  66. 'parent_item_colon' => 'Parent Categoty',
  67. 'edit_item' => 'Edit Category',
  68. 'update_item' => 'Update Category',
  69. 'add_new_item' => 'Add New Category',
  70. 'new_item_name' => 'New Category Name',
  71. 'separate_items_with_commas' => 'Separate categories with commas.',
  72. 'add_or_remove_items' => 'Add or remove categories.',
  73. 'choose_from_most_used' => 'Choose from the most used categories',
  74. )
  75. ) );
  76. }
  77.  
  78. //Create Tags Taxonomy for Support
  79.  
  80. add_action('init', 'my_custom_register_my_taxes_support_tag');
  81. function accuteach_register_my_taxes_support_tag() {
  82. register_taxonomy( 'support_tag',array (
  83. 0 => 'support',
  84. ),
  85. array( 'hierarchical' => false,
  86. 'label' => 'Tags',
  87. 'show_ui' => true,
  88. 'query_var' => true,
  89. 'show_admin_column' => true,
  90. 'labels' => array (
  91. 'search_items' => 'tag',
  92. 'popular_items' => 'Popular Tags',
  93. 'all_items' => 'All Tags',
  94. 'parent_item' => 'Parent tag',
  95. 'parent_item_colon' => 'Parent Category',
  96. 'edit_item' => 'Edit tag',
  97. 'update_item' => 'Update tag',
  98. 'add_new_item' => 'Add New tag',
  99. 'new_item_name' => 'New tag Name',
  100. 'separate_items_with_commas' => 'Separate Tags with commas.',
  101. 'add_or_remove_items' => 'Add or remove Tags.',
  102. 'choose_from_most_used' => 'Choose from the most used Tags',
  103. )
  104. ) );
  105. }
  106.  
  107. `
  108.  
  109.  
  110. Here is link to a screenshot: http://awesomescreenshot.com/0d632aoc9f
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement