0

I'm getting these 0's in front of my categories and tags:

https://www.dropbox.com/s/7v9hvf25wsw15p8/Screenshot%202014-11-08%2020.50.02.png?dl=0

Here's what the code in function looks like:

// Work columns
function work_edit_columns($columns){
   $columns = array(
                    "cb" => "<input type='checkbox' />",
                    "title" => __("Work"),
                    "work_category" => __("Category"),
                                        "work_hashtags" => __("Tags"),
                    "date" => __("Date")
                   );

   return $columns;
}


add_action("manage_work_posts_custom_column",  "work_custom_columns");

function work_custom_columns($column){
  global $post;
  switch ($column){
                 case "work_category":
                     echo get_the_term_list($post->ID, 'work_category', '', ', ','');
                 break;
   }

   global $post;
   switch ($column){
                  case "work_hashtags":
                      echo get_the_term_list($post->ID, 'work_hashtag', '', ', ','');
                  break;
     }
 }

Is there any way to remove this?

2
  • Try disabling javascript and check what happen? Also you can try disabling Plugins one by one if any of them causes the issue. Check whether you have any typo there... :) Nov 9 '14 at 6:01
  • Ah, 'Like This' Plugin was causing the 0's problem! :) Thank you :) Nov 9 '14 at 20:30
0

I'm not sure why you're getting the '0's. But you shouldn't be using 2 switch statements in work_custom_columns().

Try this:

function work_custom_columns($column){
  global $post;
  switch ($column){
                 case "work_category":
                     echo get_the_term_list($post->ID, 'work_category', '', ', ','');
                 break;

                  case "work_hashtags":
                      echo get_the_term_list($post->ID, 'work_hashtag', '', ', ','');
                  break;
     }
 }
1
  • Thank you for that one @shanebp - I figured out the problem with the '0's, and it was caused by a plugin called 'Like This'. Nov 9 '14 at 20:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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