Support » Fixing WordPress » List Custom Taxonomies in Custom Columns

  • I have run into trouble populating the custom columns on the edit.php page of a custom post type.
    I know there is plenty of discussion on this subject already, but I believe I’m running into a unique problem.

    At first I thought I just couldn’t get the custom taxonomy to populate the columns, but now it seems that I can’t get any of the columns in my custom post type to populate at all (ie. even when filled with test echo statements).

    here’s the full code:

    Note that the top two cases under switch contain test echos, none of which shows up in the columns.

    So, I have installed this code on two sites (one that runs the Hybrid theme framework) and I get two different results. On the 1st/Hybrid one, the fields do no populate at all. On the second one the fields will populate if I select “Quick Edit” and hit “Update”; if I refresh the page the column content disappears (note, this problem is similar to the problem noted by Bennst here.)

    Any help would be greatly appreciated.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Your custom post type must be set to ‘hierarchical’ => false

    check out this article :

    since your Custom Post Type is ‘cruise’ and your Custom Taxonomy in this case is ‘destination’, something like this should work:

    add_action("manage_posts_custom_column",  "show_destinations_column");
    add_filter("manage_edit-cruise_columns", "cruise_columns");
    function cruise_columns($columns){
      $columns = array(
        "cb" => "<input type=\"checkbox\" />",
        "title" => "Title",
        "categories" => "Categories",
        "destination" => "Destination",
        "test_id" => "ID",
      return $columns;
    function show_destinations_column($column){
      global $post;
      switch ($column) {
        case "destination":
    	  echo get_the_term_list($post->ID,'destination','',', ','');
        case "test_id":
    	  echo "test ID";

    Thanks for the help…
    @paulehpants: It’s a hierarchical post type, and that IS what was causing some of the problem (in the action, not the filter)…

    For pages and hierarchical custom post types you can use the following action triggers:
    For posts it’s still:
    For both non-hierarchical custom types and hierarchical custom types:

    In the end (I solved this a while ago but failed to follow up) I used pretty much the same as the above from alex,
    add_action('manage_cruise_posts_custom_column', 'show_destinations_column');

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘List Custom Taxonomies in Custom Columns’ is closed to new replies.