Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter bastiag5

    (@bastiag5)

    <?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',
                    'taxonomies' => array('post_tag'),
    			
    			);
    			
    			// Eseguo la query 
    			$the_query = new WP_Query($args); 
    			
    			// Conto gli elementi 
    			$count = $the_query->post_count;
    			?>

    I insert the code I used to generate the single tag page. The single tag link “year_work/2014/” works perfectly but I would like there to be a “year_work” page I am asking you what query I should use to retrieve the tags of a custom post so that there are for each tag 5 posts with this pattern:

    <h1>2014</h1>
        post
        
        <h1>2015</h1>
        post

    Thanks

    Thread Starter bastiag5

    (@bastiag5)

    I preferred to use tags without creating a new taxonomy. I realize that the 2015 example tag archive page works but I can’t generate a container page with all the tags in the structure I indicated in the first post. I would like to be able to see all jobs divided by year on the same page. Yes I have made a custom post and called it portfolio. I thank you for your time.

Viewing 2 replies - 1 through 2 (of 2 total)