Wordpress Custom post type


/ Published in: PHP
Save to your folder(s)

Add a custom post type of news


Copy this code and paste it in your HTML
  1. <?php
  2. function post_type_news() {
  3. register_post_type( 'New',
  4. array( 'label' => __('New'), 'public' => true, 'show_ui' => true ) );
  5. register_taxonomy_for_object_type('post_tag', 'News');
  6. }
  7. add_action('init', 'post_type_news');
  8. ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.