Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

So I have created a custom post type with custom values and customize my custom post type admin columns.

You can see here how my custom post type is looking in admin panel.

And as you can see I can order by title all posts and I was wondering if I could do same for all columns, like "info" etc.

Is it possible?

I am using this code, to display columns like I wanna :

//display catalog products in nice list
add_action("manage_posts_custom_column",  "catalog_custom_columns");
add_filter("manage_edit-catalog_columns", "catalog_edit_columns");

function catalog_edit_columns($columns){
  $columns = array(
    "cb" => "<input type=\"checkbox\" />",
    "title" => "Product Title",
    "description" => "Info",
    "skills" => "Category",
     "year" => "Price",

  );

  return $columns;
}



function catalog_custom_columns($column){
  global $post;

  switch ($column) {
    case "description":
      the_content();
      break;
     case "skills":
      echo get_the_term_list($post->ID, 'atrakcijas', '', ', ','');
      break;
    case "year":
      $custom = get_post_custom();
      echo $custom["product_price"][0]; ?>Ls<?php
      break;

  }
}
share|improve this question

1 Answer 1

up vote 0 down vote accepted

Scribu as written a great detailed tutorial named "Create your own sortable columns" just what you need.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.