Hola, básicamente tengo una plantilla de página. Al igual que para la tabla de contenidos. No quiero un complemento porque todavía quiero controlar el código.
Solo quiero preguntar si es esto posible?
==> Página de la tabla de contenido (en la categoría Edición de junio)
Luego imprime todas las informaciones de subcategoría bajo la categoría específica. como este formato:
=> Título de subcategoría
then Posts Under (this) Subcategory
-> Post Title including Permalink
-> Post Excerpt
-> Post Title including Permalink
-> Post Excerpt
-> Post Title including Permalink
-> Post Excerpt
=> Subcategoria 2 titulo
then Posts Under (this) Subcategory
-> Post Title including Permalink
-> Post Excerpt
-> Post Title including Permalink
-> Post Excerpt
-> Post Title including Permalink
-> Post Excerpt
=> Subcategoria 3 titulo
then Posts Under (this) Subcategory
-> Post Title including Permalink
-> Post Excerpt
-> Post Title including Permalink
-> Post Excerpt
-> Post Title including Permalink
-> Post Excerpt
y así..
Solo quiero saber si wordpress tiene este método.de la extracción de subcategorías en categorías de publicaciones específicas ... ¿Cómo puedo mostrarlo correctamente en la plantilla como si fuera a crear otro contenido de tabla para el próximo número? Imprimirá automáticamente todas las informaciones de subcategorías. por favor, ayúdame.
Gracias
Respuestas
0 para la respuesta № 1Prueba esto ... No probado
<?php
$args = array(
"type" => "post",
"child_of" => 0,
"parent" => "1", //Only get child categories
"orderby" => "name",
"order" => "ASC",
"hide_empty" => 1,
"taxonomy" => "category",
"pad_counts" => false
);
$categoryList = get_categories($args);
if(!empty($categoryList)){
foreach($categoryList as $category){
$postArgs = array(
"cat" => $category->id,
"post_type" => "post" //Use other options as needed
);
query_posts($postArgs);
while ( have_posts() ) : the_post();
echo get_the_title();
echo get_permalink();
echo get_the_excerpt();
endwhile;
}
}
?>