Using wp_get_archives
will return a pre-defined template for the results. You need your own custom query and template to do that. Since i don't know what exactly you are looking for, I'll have a basic code suggestion for your situation:
// Get a list of categories
$terms = get_terms(array('taxonomy' => 'category'));
// Run a query for each category
foreach ($terms as $term){
$args = array(
'post_type' => 'custom_type',
'posts_per_page' => '1',
'order_by' => 'date',
'order' => 'ASC',
'cat' => $term->ID
);
$new_query = new WP_Query ($args);
if ($new_query->have_posts()) {
while($new_query->have_posts()){
$new_query->the_post();
// Post's title
the_title();
// Post's featured image
the_post_thumbnail('thumbnail');
}
}
wp_reset_postdata();
}
This will list 1 post out of each category, and output the featured image and its title. However it will make a lot of queries if you have a lot of categories. ( like 50 or so ). I suggest you use it with a cache plugin.
You can also get a list of posts and view them in a showcase, alongside their category name:
$args = array(
'post_type' => 'custom_type', // Your custom post type
'posts_per_page' => '8', // Change the number to whatever you wish
'order_by' => 'date', // Some optional sorting
'order' => 'ASC',
);
$new_query = new WP_Query ($args);
if ($new_query->have_posts()) {
while($new_query->have_posts()){
$new_query->the_post();
the_title();
the_post_thumbnail('thumbnail');
// Get a list of post's categories
$categories = get_the_category($post->ID);
foreach ($categories as $category) {
echo $category->name;
}
}
}
wp_reset_postdata();