1

I've been working for a while on our app portfolio. Because we are adding a lot lately i've been asking myself if it's possible to order by date instead of title in the admin panel.

I have the following code:

<?php 
add_action( 'init', 'register_post_type_apps' );
function register_post_type_apps() 
{
/**
* Register some Custom Post Type(s).
*
*/
   register_post_type('apps',
   array(
      'labels' => array(
         'name' => __('Apps'),
         'singular_name' => __('apps'),
         'add_new' => __('Nieuw app'),
         'add_new_item' => __('Voeg nieuw apps item toe'),
         'edit' => __('Wijzig'),
         'edit_item' => __('Wijzig apps item'),
         'new_item' => __('Nieuw apps item'),
         'view' => __('Bekijk'),
         'view_item' => __('Bekijk apps item'),
         'search_items' => __('Zoek apps item'),
         'not_found' => __('Geen apps item gevonden' ),
         'not_found_in_trash' => __( 'Geen apps item gevonden in prullenbak' ),
         'parent' => __( 'Bovenliggend apps item' ),
      ),
      'description' => __('Een apps item wordt gebruikt om de apps mee te vullen.'),
      'public' => true,
      'publicly_queryable' => true,
      'exclude_from_search' => false,
      'show_ui' => true,
      'show_in_menu' => true,
      'menu_position' => 20,
      'menu_icon' => get_stylesheet_directory_uri() . '/images/cpt_apps_icon.png',
      'hierarchical' => true,
      'supports' => array(
         'title',
         'editor',
         'excerpt',
         'custom-fields',
         'comments',
         'thumbnail'),
      'taxonomies' => array( 'post_tag', 'category', 'page'),
      'has_archive' => 'true',
      'rewrite' => array(
         'slug' => 'apps',
         'with_front' => false ),
      'query_var' => true,
      'can_export' => true,)
   );
}

?>

Does anyone know how to get this working?

1

0

Browse other questions tagged or ask your own question.