title: How To Display Number In Post Wordpress
body: <p>I want to display the sequence number in the wordpress loop in the sidebar by category Software but the number in the sequence is not showing, I don't know how to display it.</p>
  <p>i want to show number like this</p>
  <p><img src="https://i.stack.imgur.com/Vy5M1.png" alt="enter image description here" /></p>
  <p>this is my code in sidebar.php</p>
  <pre><code>&lt;?php
      $args = array(
          'post_type' =&gt; 'post',
          'posts_per_page' =&gt; 5,
          'category_name' =&gt; 'Software'
      );
      
      $myposts = new WP_Query($args);
      
      // the loop
      if ($myposts-&gt;have_posts()):
          while ($myposts-&gt;have_posts()):
              $myposts-&gt;the_post();
              // display article
              get_template_part('template-parts/sidebar/latest-content-2', get_post_format());
          endwhile;
      endif;
      
      wp_reset_postdata();
    ?&gt;
  </code></pre>
  <p>and this my code in content.php</p>
  <pre><code> &lt;!-- POST PREVIEW --&gt;
  &lt;div class=&quot;post-preview tiny padded gaming-news&quot;&gt;
      &lt;!-- POST PREVIEW IMG WRAP --&gt;
      &lt;a href=&quot;&lt;?php the_permalink(); ?&gt;&quot;&gt;
          &lt;div class=&quot;post-preview-img-wrap&quot;&gt;
              &lt;!-- POST PREVIEW IMG --&gt;
              &lt;figure class=&quot;post-preview-img liquid&quot;&gt;
                  &lt;?php the_post_thumbnail(); ?&gt;
              &lt;/figure&gt;
              &lt;!-- /POST PREVIEW IMG --&gt;
          &lt;/div&gt;
      &lt;/a&gt;
      &lt;!-- /POST PREVIEW IMG WRAP --&gt;
      &lt;!-- BUBBLE ORNAMENT --&gt;
      &lt;div class=&quot;bubble-ornament small black no-link&quot;&gt;
          &lt;p class=&quot;bubble-ornament-info&quot;&gt;01&lt;/p&gt;
      &lt;/div&gt;
      &lt;!-- /BUBBLE ORNAMENT --&gt;
      &lt;!-- POST PREVIEW TITLE --&gt;
      &lt;a href=&quot;&lt;?php the_permalink(); ?&gt;&quot; class=&quot;post-preview-title&quot;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;
      &lt;!-- POST AUTHOR INFO --&gt;
      &lt;div class=&quot;post-author-info-wrap&quot;&gt;
          &lt;p class=&quot;post-author-info small light&quot;&gt;By &lt;a
                      href=&quot;&lt;?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?&gt;&quot;
                      class=&quot;post-author&quot;&gt;&lt;?php the_author(); ?&gt;&lt;/a&gt;&lt;span
                      class=&quot;separator&quot;&gt;|&lt;/span&gt;&lt;?php the_time( 'F j, Y' ); ?&gt;&lt;/p&gt;
      &lt;/div&gt;
      &lt;!-- /POST AUTHOR INFO --&gt;
  &lt;/div&gt;
  &lt;!-- /POST PREVIEW --&gt;
  </code></pre>