Advertisement
Guest User

Final Code

a guest
Jul 3rd, 2012
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.87 KB | None | 0 0
  1. // Image slideshow
  2.     function image_slideshow() {
  3.         $args = array('label' => __('Slides'), 'menu_position' => 5, 'public' => true, 'singular_label' => __('Slide'), 'supports' => array('title', 'editor', 'thumbnail'));
  4.         register_post_type('slides', $args);
  5.     }
  6.     add_action('init', 'image_slideshow');
  7.    
  8.     // Custom columns
  9.     function custom_columns($args) {
  10.         $args = array('cb' => '<input type="checkbox" />', 'title' => __('Title'), 'thumbnail' => __('Thumbnail'), 'author' => __('Author'), 'categories' => __('Categories'), 'tags' => __('Tags'), 'date' => __('Date'));
  11.         return $args;
  12.     }
  13.     add_filter('manage_posts_columns', 'custom_columns');
  14.    
  15.     // Image column
  16.     function image_column($args, $post_id) {
  17.         switch($args) {
  18.             case 'thumbnail':
  19.                 echo the_post_thumbnail('admin-thumbnail');
  20.             break;
  21.         }
  22.     }
  23.     add_action('manage_posts_custom_column', 'image_column', 10, 2);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement