How can I change this loop so that it displays posts from the current tag. Now it displays all posts. I need this to make the page tag.php

<?php
$current_page = (get_query_var('paged')) ? get_query_var('paged') : 1; 
$args = array(
    'posts_per_page' => 7, 
    'paged'          => $current_page 
    );
query_posts($args);

$wp_query->is_archive = true;
$wp_query->is_home = false;

while(have_posts()): the_post();
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    <div class="post_headline">
     <h3><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h3>
 </div>
 <?php
 endwhile;
 if (function_exists('custom_pagination')) {
    custom_pagination($query->max_num_pages,"",$paged);
}
?>

Read more here: How can I change this loop so that it displays posts from the current tag


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: