title: How to get category slug url working in Wordpress?
body: <p>I'm in designing a WP Theme. I need help!
  I'm calling category and it's slug from plugin functions. Here is the code:</p>
  
  <pre><code>$category = get_the_category();
  $html .= '&lt;div id="category-post" class="category-main category'. $category[0]-&gt;slug .'"&gt;';
  $html .= $category[0]-&gt;cat_name;
  $html .= '&lt;/div&gt;';
  </code></pre>
  
  <p>Let's say I have a class name for health category: .category-health</p>
  
  <p>but the above code will returned to: <code>&lt;div id="category-post" class="category-main categoryhealth"&gt;&lt;/div&gt;</code> and the class: .category-health not working because it returned to unavailable category: .categoryhealth</p>
  
  <p>From above code I feel that the category slug " - " is not working. Because the right class is ".category-health" and not ".categoryhealth"</p>
  
  <p>Is there any way to fix this? Thanks</p>