Si esto lo hice para la categoria principal generos asi
category-generos.php donde mostrare todos las sub categorias sin post!
- - - Actualizado - - -
Osea que tengo que hacer una consulta personalizada usando el nombre de la categoria, por ejemplo..
En:
category.php
PHP:
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title><?php single_cat_title(); ?></title>
</head>
<body>
<h1><?php single_cat_title(); ?></h1>
<?php
$cat = single_cat_title();
$mp3 = new WP_Query(['post_type' => 'mp3', 'category_name' => $cat, 'showposts' => 30]); ?>
<?php if($mp3->have_posts()): while($mp3->have_posts()): $mp3->the_post(); ?>
<a rel="nofollow" href="<?php echo get_the_permalink(); ?>"><?php echo get_the_title(); ?></a>
<?php endwhile; ?>
<?php wp_reset_postdata(); ?>
<?php else: ?>
<p>No hay mp3 disponibles!</p>
<?php endif; ?>
</body>
</html>