title: Add `active` class to li of current single page wordpress
body: <p>Looking for your help and advices. 
  I have a list of links to <code>single</code> in Wordpress. I need to place class <code>active</code> only to li of active page.</p>
  
  <p>Should be like on this image <a href="https://i.stack.imgur.com/x8TZ0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/x8TZ0.png" alt="enter image description here"></a></p>
  
  <p>But it is:</p>
  
  <p><a href="https://i.stack.imgur.com/L6ZIp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/L6ZIp.png" alt="enter image description here"></a></p>
  
  <p>My wp-code:</p>
  
  <pre><code>&lt;ul class="inline-list medium-6 large-4 skill-items"&gt;
  &lt;?php 
      $id = get_the_ID();
      // echo $id;
      $class;
      $skills = new WP_Query( array(
          'post_type' =&gt; 'skills',
          'order' =&gt; 'ASC'
          ));
      if ($skills-&gt;have_posts()) : while ($skills-&gt;have_posts()) : $skills-&gt;the_post();   
      // echo $post-&gt;ID;
      if( $id == $post-&gt;ID) {$class = 'active';} else {$class = '';}
      ?&gt;
      &lt;li class="&lt;?php echo $class; ?&gt;"&gt;&lt;a href="&lt;?php echo esc_url(get_permalink()); ?&gt;"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/li&gt;
      &lt;?php endwhile; endif; wp_reset_query();
  ?&gt;  
  &lt;/ul&gt;
  </code></pre>