Ciao, sono abbastanza un novizio con wordpress e php.
Sto cercando di fare una Lista di tutte le Categorie inframezzata dai titoli ultimi tre Post per ogni Categoria.
Finche si tratta di far la lista delle categorie no problem, ma invece nonb riesco a inserirci dentro il ciclo dei titoli dei post
questo è il codice su cui stavo lavorando.
<div id="col01">
<?php if (have_posts()); ?>
<?php
$args=array(
'orderby' => 'name',
'order' => 'ASC'
);
$categories=get_categories($args);
foreach($categories as $category) {
$post_args = array('numberposts' => 3, 'category' => $category, 'orderby' => 'post_date', 'order' => 'DESC', );
$posts_array = get_posts( $post_args );
echo '<div class="home-post" id="post-' . $category->name.'">
<div class="home-post-upper">
<div class="title"><h2>term_id ) . '" rel="bookmark" title="Permanent Link to ' . $category->name.'">' . $category->name.'
<div class="pop">
'foreach($lastposts as $post) : setup_postdata($post);'
</div>
</h2></div>
term_id ) . '">
</div>
</div>' ;}
?>
</div>