|
Manejar Post en Varios DIVs en Wordpress
hola amiwis
estoy en un proyecto con Wordpress el cual tengo que listar todos las últimos post en el index (tal como vienen muchos themes.)
aca viene mi enredo. lo que pasa es que el index tiene 3 tipos de divs, el cual el primero mostrará la última noticia en forma más grande (noticia principal), luego se encuentra una columna derecha donde seguirá el post 2,3,4,5 y finalmente una columna izquiera con los post 6,7,8,9,10
entonces mi enredo es como puedo hacer que los post se muestren bien si tengo divs distintos.
he logrado que me muestre bien los post hasta la columna derecha, pero en la izquierda no, incluso se me repite el último post de la izquierda.
asi lo tengo
aca el code
Código PHP:
<?php get_header(); ?> <div id="content"> <div class="feature clearfloat" id="lead"> <!--NOTICIA PRINCIPAL--> <?php $top_query = new WP_Query('showposts=1'); while($top_query->have_posts()) : $top_query->the_post(); $first_post = $post->ID; ?> <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><img src="<?php bloginfo('url'); ?>/blog20<?php $values = get_post_custom_values("Image"); echo $values[0]; ?>" alt="" id="leadpic" /> </a> <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>" class="title"> <?php the_title(); ?> </a> <?php the_excerpt(); ?> {<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">More»</a>} <?php endwhile; ?> </div>
<div id="leftcol"> <!-- COLUMNA DERECHA--> <?php if (have_posts()) : ?> <?$top_query2 = new WP_Query('showposts=5');?> <?php while($top_query2->have_posts()) : $top_query2->the_post(); if(($first_post != $post->ID) ) :?> <div class="feature"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><img src="<?php bloginfo('url'); ?>/blog20<?php $values = get_post_custom_values("Image"); echo $values[0]; ?>" alt="" /></a><a href="<?php the_permalink() ?>" rel="bookmark" class="title"> <?php the_title(); ?>»</a> </div> <?php endif; endwhile; $first_post2 = $post->ID;?> </div> <div id="rightcol"> <!-- COLUMNA IZQUIERDA--> <div class="clearfloat"> <?$top_query2 = new WP_Query('showposts=5');?> <?php while($top_query2->have_posts()) : $top_query2->the_post(); if(($first_post2 == $post->ID) ) :?> <?php $values = get_post_custom_values("Image");?> <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><img src="<?php bloginfo('url'); ?>/blog20<?php $values = get_post_custom_values("Image"); echo $values[0]; ?>" alt="" /></a> <a href="<?php the_permalink() ?>" rel="bookmark" class="title"> <?php the_title(); ?>»</a> <?php the_excerpt(); ?><br /> <?php endif; endwhile; endif;?> </div> </div> </div><!--END CONTENT-->
<?php get_sidebar(); ?> <?php get_footer(); ?>
si alguien sabe porfis help me!
Editado por specialized en 06-Jun-2008 a las 22:26.
|