wp parse args – tag archive page not found

Question

I am fairly new to wordpress…
I don’t understand where I am going wrong but I would like to create an archive page of all the tags I have used in a custom post. Basically I used the tags to split the years 2014 2015 2016 etc I would like to show all the posts within that tag with this pattern:

<h1>2014</h1>
post

<h1>2015</h1>
post

I created tag-2015.php and it works without a problem when I go to create tag.php it gives me page not found. My starting code

<?php 
            // Resetto la query se necessario
            //wp_reset_postdata();
            
            /** 
             * Preparo gli argomenti
             *
             * Possibili parametri:
             * 'orderby'                => 'title',
             * 'order'                  => 'ASC',
             * 'posts_per_page'         => 3,
             * 'category_name'          => 'featured',
             * 'cat'                    => -1 //esclude una categoria o pi첫 categorie dalla query
             */ 
            $args = array(
                'post_type' => 'portfolio',
                'order'     => 'DIS',
            
            );
            
            // Eseguo la query 
            $the_query = new WP_Query($args); 
            
            // Conto gli elementi 
            $count = $the_query->post_count;
            ?>

Thanks for the help
Andrea

0
bastiag5 2 months 2022-12-15T17:32:59-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse