Ver Mensaje Individual
  #2 (permalink)  
Antiguo 20/11/2007, 19:49
lanas
 
Fecha de Ingreso: abril-2005
Mensajes: 50
Antigüedad: 19 años, 1 mes
Puntos: 1
Re: cómo establecer una única categoría para la portada?

pues yo lo respondo, la solución está en los templtes tags y en modificar the loop en index.php:

Código PHP:
<?php if (have_posts()) : ?> 
        
        <?php while (have_posts()) : the_post(); ?>

                 <?php if ( in_category(1) ): ?> <-- Aquí selecciono la categoría que quiero ver -->
                
            <div class="post" id="post-<?php the_ID(); ?>">
                <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Ligaz&oacute;n Fixa a <?php the_title(); ?>"><?php the_title(); ?></a></h2>
                <small><?php the_time('F jS, Y'?> <!-- by <?php the_author() ?> --></small>
                
                <div class="entry">
                    <?php the_content('Ler o resto desta anotaci&oacute;n &raquo;'); ?>
                </div>
        
                <p class="postmetadata">Anotado en <?php the_category(', '?> | <?php edit_post_link('Editar'''' | '); ?>  <?php comments_popup_link('Sen Comentarios »''Un Comentario »''% Comentarios »'); ?></p>
            </div>
               <?php endif; ?>  <-- Aquí termina la selleción de la categoría -->
        <?php endwhile; ?>

        <div class="navigation">
            <div class="alignleft"><?php next_posts_link('&laquo; Anotaci&oacute;ns Anteriores'?></div>
            <div class="alignright"><?php previous_posts_link('Anotaci&oacute;ns Seguintes &raquo;'?></div>
        </div>
        
    <?php else : ?>

        <h2 class="center">Non se Atopou</h2>
        <p class="center">Sintoo, pero est&aacute; a buscar algo que non se atopa aqu&iacute;.</p>
        <?php include (TEMPLATEPATH "/searchform.php"); ?>

    <?php endif; ?>
Salud¡