Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Back-end columns; echo taxonomy WordPress

  • SOLVED

I have a taxonomy for my custom post types.
This is the code:


add_action("manage_posts_custom_column", "my_custom_columns");
add_filter("manage_edit-homes_columns", "my_homes_columns");

function my_homes_columns($columns) //this function display the columns headings
{
$columns = array(
"cb" => "<input type=\"checkbox\" />",
"title" => "Home Title",
"description" => "Description",
"availability" => "Availability",
);
return $columns;
}

function my_custom_columns($column)
{
global $post;
if ("ID" == $column) echo $post->ID;
elseif ("description" == $column) echo $post->post_content;
elseif ("availability" == $column) echo $post->post_category;
}


<strong>This is the only piece of code that's not working:</strong>
elseif ("availability" == $column) echo $post->post_category;

Ho w do I echo the taxonomy there?

Answers (1)

2011-03-10

Sébastien | French WordpressDesigner answers:

replace
elseif ("availability" == $column) echo $post->post_category;
by
elseif ("availability" == $column) echo get_the_term_list( $post->ID, 'availability', '', ', ', '' );