Category page is reload wrong template
-
Category page is reload wrong template:
Eng-:
Hi! Thank you for your attention and help. I am creating my first WordPress Theme and I want to show two categories on different pages. I have in each page a layout of two asymmetrical parts one with the content and the other with the titles and permalinks of all posts in that category. When loading the category (category template) the loop filters well. But when I access another post in the list reloads the entire page and loads what I have in “content.php”. I think maybe I have problems calling the “content.php”. How could you do to get only the content (maybe with ‘get template part’) and to continue filtering the result of the loop with the same parameters, keeping this list of post filtered by category?
Create two content in a “frontcategory /” subfolder: “content-1.php” and “content-2.php”
I think it would be an option but I do not know how to apply it——————————————————————-
Esp-:
¡Hola! Desde ya agradezco su atención y ayuda. Estoy creando mi primer WordPress Theme y quiero mostrar dos categorías en diferentes páginas. Tengo en cada una de páginas un layout de dos partes asimétricas una con el contenido y la otra con los títulos y el permalinks de todos los post de esa categoría. Al momento de cargar la categoría (category template) el loop filtra bien. Pero cuando accedo a otro post de la lista se recarga toda la página y carga lo que tengo en “content.php” . Pienso que tal vez tengo problemas llamando al “content.php”. Como podria hacer para obtener solo el “content” (tal vez con ‘get template part’) y que se siga filtrando el resultado del loop con los mismo parámetros, manteniendo esta lista de post filtrados por categoría ?
Cree dos content en una subcarpeta “frontcategory/” : “content-1.php” y “content-2.php”
creo que seria una opción pero no se como aplicarlacategory-1.php <div id="primary" class="content-area"> <main id="main" class="site-main" role="main"> <div class="left-side blog"> <article> <?php $args = array( 'posts_per_page' => 1, 'offset'=> 0, 'category' => 3, 'order'=> 'ASC'); $myposts = get_posts( $args ); foreach ( $myposts as $post ) : setup_postdata( $post ); the_title( '<h1 class="entry-title">', '</h1>' ); $dias = array("Domingo","Lunes","Martes","Miercoles","Jueves","Viernes","Sábado"); $meses = array("Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"); echo "<span class='date-post'>(".$dias[get_the_date('w')]." ".get_the_date('d')."/".$meses[get_the_date('n')-1]. "/".get_the_date('Y').")</span>" ; the_content('<div class="entry-content">','</div>'); ?> <?php endforeach; /*wp_reset_postdata();*/?> </article> </div> <div class="mid-side blog"> <h2 class="title-category"> Blog</h2>-
<?php
$args = array( 'posts_per_page' => -1, 'offset'=> 0, 'category' => 3, 'order'=> 'ASC');
$myposts = get_posts( $args );
foreach ( $myposts as $post ) : setup_postdata( $post ); ?>
- "><?php the_title(); ?> <?php endforeach; wp_reset_postdata();?>
The topic ‘Category page is reload wrong template’ is closed to new replies.