Ver Mensaje Individual
  #1 (permalink)  
Antiguo 03/10/2011, 03:00
julio_jag_cc
 
Fecha de Ingreso: enero-2011
Ubicación: Madrid
Mensajes: 35
Antigüedad: 13 años, 4 meses
Puntos: 3
Pregunta Filtrar contenido por categoría en pagina

Buenas amigos, estoy haciendo una plantilla de pagina para que enseñe las ultimas imágenes subidas al servidor, hasta ahi todo bien. El problema viene que la pagina me muestra todas las entradas, las que tienen imágenes y las que noy y yo solo quiero que muestre la de una categoria elejida.

HAbria alguna manera de filtrar las entradas por categoría y asi indicarle cuales quiero que muestre y cuales no, sabéis como puedo hacer??

Os lo dejo para que lo veais y me digais graciass!!

Código:
<?php



/*



Template Name: imagenes





*/



?>







<?php get_header(); ?>







<div id="casing">

<div id="content" class="rounded">





<?php if (have_posts()) : ?>

<?php while (have_posts()) : the_post(); ?>









		

<div class="pge" id="pge-<?php the_ID(); ?>">

<div class="title">



</div>





				

<div class="cover">

<div class="entry">





			

				

				<?php

				$args = array( 'post_type' => 'post', 'paged'=>$paged );

				$loop = new WP_Query( $args );

				$i = 1;

				

				while ( $loop->have_posts() ) : $loop->the_post(); ?>

				

					<?php include( TEMPLATEPATH . '/includes/show-screenshots.php' ); ?>

					

				<?php endwhile; ?>

		<div class="clear"></div>

 <?php wp_link_pages(array('before' => '<p><strong>Pages: </strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>

</div>



</div>



</div>



<?php endwhile; endif; ?>

	</div>		





<?php get_footer(); ?>


Y el archivo al que hace la llamada:


Código:
				<?php if($i%2 == 0) : ?>



				<div class="media-item last">

				

					<div class="media-thumb">

						<div class="screenshot-icon"></div>

						<a href="<?php the_permalink(); ?>" rel="bookmark" title=" <?php the_title(); ?>"><?php the_post_thumbnail('media-thumb-small'); ?></a>

						<div class="media-arrows"></div>

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

						<div class="media-meta-wrapper">

							<span class="media-meta"><?php the_time( get_option('date_format') ); ?></span>

							<span class="media-cats"><?php echo get_the_term_list( $post->ID, 'category', '',', ' ) ?></span>

						</div>

					</div>

				

				</div>



				<?php else : ?>



				<div class="media-item">

				

					<div class="media-thumb">

						<div class="screenshot-icon"></div>

						<a href="<?php the_permalink(); ?>" rel="bookmark" title=" <?php the_title(); ?>"><?php the_post_thumbnail('media-thumb-small'); ?></a>

						<div class="media-arrows"></div>

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

						

						<div class="media-meta-wrapper">

							<span class="media-meta"><?php the_time( get_option('date_format') ); ?></span>

							<span class="media-cats"><?php echo get_the_term_list( $post->ID, 'category', '',', ' ) ?></span>



						</div>

					</div>

				

				</div>



				<?php endif; ?>



				<?php $i--; ?>