Hey! Ben wordpress kategori sadece alt .. değil, alt kategorinin alt kategorileri, özleri bir işlev gerekir. Teşekkürler!
<?php if (is_category()) {
$this_category = get_category($cat);
if (get_category_children($this_category->cat_ID) != "") {
$args = array('child_of' => $this_category->cat_ID);
$subcategorii = get_categories($args);
foreach($subcategorii as $subcategorie) {
echo ' <li class="postWrapper" id="categorie"><a href="'.$subcategorie->link.'"><h5>'.$subcategorie->name.'</h5></a>';
query_posts('cat='.$subcategorie->term_id.'&posts_per_page=3');
if ( has_post_thumbnail() ) the_post_thumbnail( 'mic' );
echo '<ul>';
if ( have_posts() ) : while ( have_posts() ) : the_post();
echo '<li><a href="'.get_permalink().'">'.get_the_title().'</a></li>';
endwhile;
echo '</ul>';
echo '</li>';
else:
echo 'niciun articol!';
endif;
//Reset Query
wp_reset_query();
}
} else {
query_posts('cat='.$this_category->cat_ID.'&posts_per_page=3');
echo '';
if ( have_posts() ) : while ( have_posts() ) : the_post();
echo '<li class="postWrapper" id="post">';
echo '<a href="'.get_permalink().'">'; if ( has_post_thumbnail() ) the_post_thumbnail( 'mic' );
echo '<h3 class="postTitle">'.get_the_title().'</h3></a>';
echo '</li>';
endwhile;
echo '';
else:
echo 'niciun articol!';
endif;
}
}
?>