diff --git a/eduinafoldcode/php/evidenza.php b/eduinafoldcode/php/evidenza.php new file mode 100644 index 0000000..6560e21 --- /dev/null +++ b/eduinafoldcode/php/evidenza.php @@ -0,0 +1,55 @@ + 'collezioni', + 'field' => 'slug', + 'terms' => 'evidenza', + ) + ); + + $q0 = new WP_Query( array( 'posts_per_page' => 1, + 'tax_query' => $qtax, + )); + $q = new WP_Query( array( 'posts_per_page' => 4, 'offset' => 1, + 'tax_query' => $qtax, + )); + + $gridup = '
'; + + if ( $q0->have_posts() ) { + while ( $q0->have_posts() ) { + $q0->the_post(); + $thumb = get_the_post_thumbnail($post->ID, 'full'); + $gridup = $gridup.'
'.$thumb.'

'.get_the_title().'

'; + } + $gridup = $gridup.'

'; + /* ripristino */ + wp_reset_postdata(); + } else { + $gridup = '

Nessun articolo trovato

'; + } + + $grid = $gridup.'
'; + + if ( $q->have_posts() ) { + while ( $q->have_posts() ) { + $q->the_post(); + $thumb = get_the_post_thumbnail($post->ID, 'thumbnail'); + $grid = $grid.'
'.$thumb.'

'.get_the_title().'

'; + } + $grid = $grid.'
'; + /* ripristino */ + wp_reset_postdata(); + } else { + $grid = '

Nessun articolo trovato

'; + } + + return $grid; + + }