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

Limitar los resultados en mi Home Wordpress

Estas en el tema de Limitar los resultados en mi Home Wordpress en el foro de WordPress en Foros del Web. EN mi Index de wordpress se puede ver una Noticia principal como destacado y abajo las restantes. lo que yo quiero es q en la ...
  #1 (permalink)  
Antiguo 21/10/2009, 10:18
 
Fecha de Ingreso: mayo-2008
Mensajes: 5
Antigüedad: 16 años
Puntos: 0
De acuerdo Limitar los resultados en mi Home Wordpress

EN mi Index de wordpress se puede ver una Noticia principal como destacado y abajo las restantes.

lo que yo quiero es q en la aprte de abajo solo me aparezcan 4 noticias mas y e resto sea archivo, mirando el codigo de wirdpress no lo consigo.

Osea el FEATURED es la destacada y donde dice Mas noticias aparecen el resto.

ESTE ES EL CIDGO DE MI INDEX.PHP

Código:
<?php get_header(); ?>

<?php if (is_home() && !is_paged()) {

$sticky=get_option('sticky_posts');

$the_query = new WP_Query('showposts=1&p=' . $sticky[0]);

if ($the_query->have_posts()) :

  while ($the_query->have_posts()) : $the_query->the_post();

  $do_not_duplicate = $post->ID;

?>

	<!-- featured -->		

	<div id="featured">			

	

		<div id="featured-block" class="clear">

			

			<div id="featured-ribbon"></div>

			

			<div class="image-block">

              <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><img src="<?php if(get_post_meta($post->ID, "image_value", $single = true) != "") { echo get_post_meta($post->ID, "image_value", $single = true); } else { ?><?php bloginfo('template_url'); ?>/images/img-featured.jpg<?php } ?>" alt="featured" width="350px" height="250px"/></a>

         </div>			

			

			<div class="text-block">

			

				<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>

			

				<p class="post-info">Publicado por <?php the_author(); ?> | en la categoria <?php the_category(', ') ?></p>

				

				<?php the_excerpt(); ?>

			

				<p><a href="<?php the_permalink(); ?>" class="more-link">Leer Más >></a></p>				

								

			</div>				

		

		</div>		

	

	<!-- /featured -->

	</div>	

<?php endwhile; endif; } ?>

	

	<!-- content -->

	<div id="content-wrap" class="clear">

	

		<div id="content">		

			

			<!-- main -->

			<div id="main">	

					

				<h3>Más Noticias >></h3>
		
<?php

$c = 0;

if (have_posts()) : while (have_posts()) : the_post(); 

if   ( $post->ID == $do_not_duplicate ) { continue; update_post_caches($posts); }

$c++;

?>
				

				<div class="block<?php echo $myclass; ?>">

				

					<?php if(get_post_meta($post->ID, "pimage_value", $single = true) != "") { ?><img src="<?php echo get_post_meta($post->ID, "pimage_value", $single = true); ?>" class="thumbnail" alt="img" width="240px" height="100px"/></a><?php } ?>

				

					<div class="blk-top">

					

						<h4><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h4>	

						<p><span class="datetime"><?php the_time('F j, Y'); ?></span><a href="<?php comments_link(); ?>" class="comment"><?php comments_number(); ?></a></p>

						

					</div>						

					

					<div class="blk-content">

						

						<?php the_excerpt(); ?>			

								

						<p><a class="more" href="<?php the_permalink(); ?>">Leer Más&raquo;</a></p>

					

					</div>

				

				</div>

				

				<?php if(!($c % 2) == 1) { ?><div class="fix"></div><?php } ?>

<?php endwhile; endif; ?>		

			

			<!-- /main -->	

			</div>

		

<?php get_sidebar(); ?>

<?php get_footer(); ?>

Última edición por elcolodeguillon; 21/10/2009 a las 10:26
  #2 (permalink)  
Antiguo 22/10/2009, 15:34
Avatar de armandoweb  
Fecha de Ingreso: enero-2003
Ubicación: San Cristobal, Santa Fe, Argentina
Mensajes: 544
Antigüedad: 21 años, 3 meses
Puntos: 7
Respuesta: Limitar los resultados en mi Home Wordpress

Hola:

Con esto mostras solo los ultimos 4 posts de la categoria 13. Adaptalo a lo que necesitas.

Código PHP:
<?php $recent = new WP_Query("cat=13&showposts=4"); while($recent->have_posts()) : $recent->the_post();?>
<a href="<?php the_permalink() ?>" rel="bookmark">
<?php the_title(); ?>
</a>
<?php endwhile; ?>
Saludos.

ARMANDOWEB
__________________
www.awdesarrollos.com.ar - [twitter: @armandoweb] - [Skype: awdesarrollos"]
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

SíEste tema le ha gustado a 1 personas




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