Foros del Web » Creando para Internet » Sistemas de gestión de contenidos » WordPress »

[AYUDA] No muestra mas de 3 post en las categorias.

Estas en el tema de [AYUDA] No muestra mas de 3 post en las categorias. en el foro de WordPress en Foros del Web. Estoy adaptando el template leanmagazine en mi blog. Seleccione para que se muestren solo 3 post en el index del blog y note que cuando ...
  #1 (permalink)  
Antiguo 22/05/2009, 13:56
Avatar de Wonza99  
Fecha de Ingreso: marzo-2009
Mensajes: 54
Antigüedad: 15 años, 1 mes
Puntos: 0
[AYUDA] No muestra mas de 3 post en las categorias.

Estoy adaptando el template leanmagazine en mi blog. Seleccione para que se muestren solo 3 post en el index del blog y note que cuando ingresas a una categoría tambien muestra solo 3 post. Me preguntaba si se podia modificar algo en el codigo para que me muestre todas las entradas que hay bajo esa categoría.

Les adjunto el codigo del archivo archive.php con el fin de que me ayuden a encontrar el texto a modificar para que me muestre la totalidad de las entradas ya que lo estuve viendo bien detallado y no logro hacerlo.

Código:
<?php get_header(); ?>
	
	<!-- BEGIN content -->
	<div id="content"><div class="head"><div class="foot">
	
		<?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
		<?php /* If this is a category archive */ if (is_category()) { ?>
		<h2 class="atitle">Archivos dentro de la categoría <strong><?php single_cat_title(); ?></strong></h2>
		<?php /* If this is a tag archive */ } elseif( is_tag() ) { ?>
		<h2 class="atitle">Posts Tagged <strong><?php single_tag_title(); ?></strong></h2>
		<?php /* If this is a daily archive */ } elseif (is_day()) { ?>
		<h2 class="atitle">Archive for <?php the_time('F jS, Y'); ?></h2>
		<?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
		<h2 class="atitle">Archive for <?php the_time('F, Y'); ?></h2>
		<?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
		<h2 class="atitle">Archive for <?php the_time('Y'); ?></h2>
		<?php /* If this is an author archive */ } elseif (is_author()) { ?>
		<h2 class="atitle">Author Archive</h2>
		<?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
		<h2 class="atitle">Blog Archives</h2>
		<?php } ?>
	
		<?php
		if (have_posts()) : $first = true;
		while (have_posts()) : the_post();
		$arc_year = get_the_time('Y');
		$arc_month = get_the_time('m');
		$arc_day = get_the_time('d');
		?>
		
		<!-- begin post -->
		<div class="<?php if ($first) echo 'first '; ?>post">
		<div class="l">
			<a href="<?php the_permalink(); ?>"><?php dp_attachment_image($post->ID, 'thumbnail', 'alt="' . $post->post_title . '"'); ?></a>
		</div>
		<div class="r">
			<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
			<p><?php echo dp_clean($post->post_content, 300); ?></p>
			<p class="details"><a href="<?php echo get_day_link("$arc_year", "$arc_month", "$arc_day"); ?>"><?php the_time('m.j.Y') ?></a> | <?php the_category(', ') ?> | <?php the_author_posts_link(); ?></p>
			<p class="comments"><?php comments_popup_link('Sin Consultas', '1 Consulta', '% Consultas'); ?></p>
		</div>
		</div>
		<!-- end post -->
		
		<?php $first = false; endwhile; else : ?>
		<div class="notfound">
		<h2>Not Found</h2>
		<p>Sorry, but you are looking for something that is not here.</p>
		</div>
		<?php endif; ?>
	
		<?php include("bottom.php"); ?>
		
		<!-- begin post navigation -->
		<div class="postnav">
		<?php if(function_exists('wp_page_numbers')) { wp_page_numbers(); } ?>
		</div>
		<!-- end post navigation -->
		
		<div class="break"></div>
	
	</div></div></div>
	<!-- END content -->
	
<?php get_sidebar(); get_footer(); ?>
Gracias.
  #2 (permalink)  
Antiguo 23/05/2009, 10:59
Avatar de WillxD  
Fecha de Ingreso: febrero-2009
Ubicación: Lima =D!
Mensajes: 82
Antigüedad: 15 años, 2 meses
Puntos: 3
Respuesta: [AYUDA] No muestra mas de 3 post en las categorias.

El template que toma por defecto las categorías es la del "index.php" (siempre y cuando no exista category.php) y no del archive.php.

Y como en tu panel haz puesto que solo se vean 3 post, por defecto tambien en tus categorías se ven solo 3 post.

Lo que debes hacer es hacer una copia del index.php y llamarlo "category.php".

Espero que con eso se solucione tu problema.

Salu2!
  #3 (permalink)  
Antiguo 23/05/2009, 17:10
Avatar de Wonza99  
Fecha de Ingreso: marzo-2009
Mensajes: 54
Antigüedad: 15 años, 1 mes
Puntos: 0
Respuesta: [AYUDA] No muestra mas de 3 post en las categorias.

Hola WillxD, gracias por responder.

Te comento que duplique el archivo y lo llame category.php y no paso nada. Yo creo que de ser asi como vos decis. Que toma la cantidad de muestra de post desde el index.php supongo que tengo que modificar alguna linea que muestre de donde tomar la cantidad de post a mostrar, el tema es que estoy viendo el codigo del index.php y no logro darme cuenta.

Adjunto el index.php por si alguien se da cuenta y me quiere ayudar.

Código:
<?php get_header(); ?>
	
	<!-- BEGIN content -->
	<div id="content"><div class="head"><div class="foot">
	
		<?php 
		$tmp_query = $wp_query;
		query_posts('cat=' . get_cat_ID(dp_settings('featured')));
		if (have_posts()) :
		$first = true;
		while (have_posts()) : the_post();
		ob_start();
		?>
		<li<?php if ($first) echo ' class="first"'; ?>><a href="<?php the_permalink(); ?>"><?php dp_attachment_image($post->ID, 'full', 'alt="' . $post->post_title . '"'); ?></a></li>
		<?php
		$photos .= ob_get_clean();
		ob_start();
		?>
		<li<?php if ($first) echo ' class="first"'; ?>>
			<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
			<p><?php echo dp_clean($post->post_content, 300); ?></p>
			<a href="<?php the_permalink(); ?>" class="readmore">VER NOTA COMPLETA</a>
		</li>
		<?php
		$text .= ob_get_clean();
		$first = false;
		endwhile;
		endif;
		?>
	
		<!-- begin featured -->
		<div class="featured">
		<h2 class="title">Titulo Blog</h2>
		<div class="thumb"><div class="b">
			<ul class="photo">
			<?php echo $photos; ?>
			</ul>
			<ul class="text">
			<?php echo $text; ?>
			</ul>
		</div></div>
		</div>
		<!-- end featured -->
		
		<?php
		$wp_query = $tmp_query;
		if (have_posts()) :
		while (have_posts()) : the_post();
		$arc_year = get_the_time('Y');
		$arc_month = get_the_time('m');
		$arc_day = get_the_time('d');
		?>
		
		<!-- begin post -->
		<div class="post">
		<div class="l">
			<a href="<?php the_permalink(); ?>"><?php dp_attachment_image($post->ID, 'thumbnail', 'alt="' . $post->post_title . '"'); ?></a>
		</div>
		<div class="r">
			<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
			<p><?php echo dp_clean($post->post_content, 300); ?></p>
			<p class="details"><?php the_category(', ') ?></p>
			<p class="comments"><?php comments_popup_link('Ver nota completa', '1 Consulta', '% Consultas'); ?></p>
		</div>
		</div>
		<!-- end post -->
		
		<?php endwhile; else : ?>
		<div class="notfound">
		<h2>Not Found</h2>
		<p>Sorry, but you are looking for something that is not here.</p>
		</div>
		<?php endif; ?>
	
		<?php include("bottom.php"); ?>
		
		<!-- begin post navigation -->
		<div class="postnav">
		<?php if(function_exists('wp_page_numbers')) { wp_page_numbers(); } ?>
		</div>
		<!-- end post navigation -->
		
		<div class="break"></div>
	
	</div></div></div>
	<!-- END content -->
	
<?php get_sidebar(); get_footer(); ?>
Desde ya muchas gracias.
  #4 (permalink)  
Antiguo 23/05/2009, 17:51
Avatar de WillxD  
Fecha de Ingreso: febrero-2009
Ubicación: Lima =D!
Mensajes: 82
Antigüedad: 15 años, 2 meses
Puntos: 3
Respuesta: [AYUDA] No muestra mas de 3 post en las categorias.

Estuve viendo el theme que estas usando y encontré la razón en el index.php

Código:
		<?php
		$tmp_query = $wp_query;
		query_posts('showposts=3&cat=' . get_cat_ID(dp_settings('featured')));
		if (have_posts()) :
		while (have_posts()) : the_post(); 
		?>
Debes cambiar, lo que te resalté por el número de post que quieres que te muestre.
  #5 (permalink)  
Antiguo 23/05/2009, 18:28
Avatar de Wonza99  
Fecha de Ingreso: marzo-2009
Mensajes: 54
Antigüedad: 15 años, 1 mes
Puntos: 0
Respuesta: [AYUDA] No muestra mas de 3 post en las categorias.

Que extraño, puse los atributos que me marcaste y me sigue mostrando la misma cantidad en la categoria y el index, sigue dependiendo del valor que le ponga desde las opciones de wordpres.
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 14:22.