Ver Mensaje Individual
  #4 (permalink)  
Antiguo 02/04/2013, 10:35
quimfv
Colaborador
 
Fecha de Ingreso: marzo-2008
Ubicación: Sabadell
Mensajes: 4.897
Antigüedad: 16 años, 1 mes
Puntos: 574
Respuesta: Dividir una categoría en varios divs

Código PHP:
Ver original
  1. <?php $lastposts = get_posts('category_name=Name&numberposts=4');
  2. $i=1;
  3. foreach($lastposts as $post) : setup_postdata($post); ?>
  4.  
  5. <li id="post<?php echo $i;?>">
  6.   <p>
  7.     <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
  8. </p>
  9. <a href="<?php the_permalink(); ?>" rel="bookmark">
  10.      <img src="<?php echo catch_that_image() ?>"/>
  11. </a>              
  12. <?php excerpt('20');?>
  13. <a href="<?php the_permalink(); ?>" rel="bookmark">
  14.     <div id="readmore">Ver detalles</div>
  15. </a>
  16. </li>
  17. <?php
  18. $i++;
  19. endforeach; ?>

Ahora cada li tiene su id!!!!
__________________
Quim
--------------------------------------------------
Ayudar a ayudar es una buena práctica!!! Y da buenos resultados.