title: How to add filter by date, last week, last month and category in post page of wordpress?
body: <p>I want to achieve a post page that has filtering just like this <a href="https://i.stack.imgur.com/UpDAK.png" rel="nofollow noreferrer">enter image description here</a></p>
  <p>Here is my code in my index.php file its only a grid display of all my post, how can achieve this look and function?</p>
  <pre><code>        &lt;?php if ( have_posts() ): ?&gt;
  
              &lt;h1&gt;
                  &lt;?php echo __('Latest Updates', 'wp_babobski')?&gt;
              &lt;/h1&gt;
  
                  &lt;?php while ( have_posts() ) : the_post(); ?&gt;
                  &lt;div class=&quot;col-md-4 gy-2 gx-5 pt-3 pb-3 px-3&quot;&gt;
                  &lt;div class=&quot;newspage&quot;&gt;
                      &lt;img class=&quot;img-fluid rounded&quot; src=&quot;&lt;?php echo get_the_post_thumbnail_url(); ?&gt;&quot; &gt;
                      &lt;h5 class=&quot;heading pt-2 pb-2&quot;&gt;
                          
                      &lt;a class=&quot;newstitle&quot; href=&quot;&lt;?php esc_url( the_permalink() ); ?&gt;&quot; title=&quot;&lt;?php the_title(); ?&gt;&quot; rel=&quot;bookmark&quot;&gt;
                          &lt;?php the_title(); ?&gt;
                      &lt;/a&gt;
                  
                      &lt;/h5&gt;
                      
                      &lt;?php the_excerpt(); ?&gt;
                      &lt;a href=&quot;&lt;?php the_permalink(); ?&gt;&quot; class=&quot;btn btn-secondary&quot;&gt;Read More&lt;/a&gt;
          &lt;/div&gt;
          &lt;/div&gt;
                  &lt;?php endwhile; ?&gt;
              
  
          &lt;?php else: ?&gt;
              &lt;h1&gt;
                  &lt;?php echo __('Nothing to show yet.', 'wp_babobski')?&gt;
              &lt;/h1&gt;
          &lt;?php endif; ?&gt;
  
  
          &lt;nav aria-label=&quot;Page navigation example&quot;&gt;        
                          &lt;ul class=&quot;pagination justify-content-center&quot;&gt;
                              &lt;?php
                                  global $wp_query;
                                  $big = 999999999; // need an unlikely integer
  
                              echo paginate_links( array(
                                  'base' =&gt; str_replace( $big, '%#%', esc_url( get_pagenum_link( $big )  ) ),
                                  'format' =&gt; '?paged=%#%',
                                  'current' =&gt; max( 1, get_query_var('paged') ),
                                  'total' =&gt; $wp_query-&gt;max_num_pages
                          ) );
                      ?&gt;
  
                  &lt;/ul&gt;
          &lt;/nav&gt;     
  </code></pre>