title: add class if child category wordpress
body: <p>I've got this code:</p>
  
  <pre><code>&lt;?php
  $terms = get_terms("category");
  $count = count($terms);
  $url= get_bloginfo("url");
   if ( $count &gt; 0 ){
   echo "&lt;ul class='spis_kate'&gt;";
   foreach ( $terms as $term ) {
  $nazwa = $term-&gt;name;
  $wyswietl= strtolower($nazwa);
  $przed = array ('ą', 'ę', 'ó', 'ś', 'ć', 'ń', 'ź', 'ż', 'ę', 'ł', ' ');
  $po = array ('a', 'e', 'o', 's', 'c', 'n', 'z', 'z', 'e','l', '-');
  $wynik= str_replace($przed, $po, $wyswietl);
     echo "&lt;li&gt;&lt;a href=".$url."/produkt/?category_name=" . $wynik. "&gt;" . $term-&gt;name . "&lt;/a&gt;&lt;/li&gt;";
  
   }
   echo "&lt;/ul&gt;";
   }
  ?&gt;
  </code></pre>
  
  <p>How to add a class (for example child) to the li if the category is child.</p>