display posts in multiple columns organized by categories

0

As I have a limited knowledge of php, I would like to get a sense of the code needed for wordpress to achieve the following:

Assuming you have x categories, you should display x columns (one for category) on the homepage of the site, where the most recent n posts in each category should be displayed in each column. in the pages of each category, should follow the same pattern, but each column will be related to the subcategories of the parent category.

Could someone give me some tips on how to do this, starting with which file should I change to for the code needed to do this?

    
asked by anonymous 07.09.2015 / 03:20

1 answer

0

I use the following form:

<?php $args = array(
            'post_type' => 'noticia',
            'posts_per_page' => 3, //Número de posts
            'tax_query' => array(
                'relation' => 'AND',
                array(
                    'taxonomy' => 'noticias',
                    'field' => 'slug',
                    'terms' => array(
                        'regiao'// Categoria a ser exibida
                    )
                )
            )
        );
        $loop = new WP_Query( $args );
        while ( $loop->have_posts() ) : $loop->the_post();?>
    
08.09.2015 / 15:27