Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Image slideshow
- function image_slideshow() {
- $args = array('label' => __('Slides'), 'menu_position' => 5, 'public' => true, 'singular_label' => __('Slide'), 'supports' => array('title', 'editor', 'thumbnail'));
- register_post_type('slides', $args);
- }
- add_action('init', 'image_slideshow');
- // Custom columns
- function custom_columns($args) {
- $args = array('cb' => '<input type="checkbox" />', 'title' => __('Title'), 'thumbnail' => __('Thumbnail'), 'author' => __('Author'), 'categories' => __('Categories'), 'tags' => __('Tags'), 'date' => __('Date'));
- return $args;
- }
- add_filter('manage_posts_columns', 'custom_columns');
- // Image column
- function image_column($args, $post_id) {
- switch($args) {
- case 'thumbnail':
- echo the_post_thumbnail('admin-thumbnail');
- break;
- }
- }
- add_action('manage_posts_custom_column', 'image_column', 10, 2);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement