Ver Mensaje Individual
  #1 (permalink)  
Antiguo 05/08/2012, 19:32
ormax1979
 
Fecha de Ingreso: agosto-2012
Mensajes: 1
Antigüedad: 11 años, 8 meses
Puntos: 0
Modificando plantilla wordpress - fichero index.php

Hola, estoy trabajando en una web de noticias y cultura en general, he comenzado trabajando con wordpress y una plantilla gratuita, la he ido modificando y hasta ahora voy bien, pero en el index hay una secuencia que construye unos div en donde van apareciendo las ultimas entradas publicadas, originalmente eran solo 2 div que exponian las ultimas entradas, pero yo he copiado el codigo y lo he repetido 12 veces de manera de tener 12 div con las ultimas entradas, ademas he modificado el CSS de forma de diagramarlo mejor... el asunto es que solo me aparecen solo las 3 ultimas entradas y en los restantes 9 div me repite la ultima entrada...
paso a exponerles el codigo ya modificado, si es que me pueden ayudar
gracias.
nota: he debido acortar el codigo hasta el div nº5 porque me pasaba en la cantidad de caracteres admitidos por el foro, pero creo se entiende la idea.

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


<div id="content">

<?php include (TEMPLATEPATH '/slide.php'); ?>    

<div class="high-box lbox"> <!-- #################  highlight category-1 #################### -->
<?php $high_cat1 get_option('repo_high_cat1'); ?>
<h2 class="high-cat"><?php echo $high_cat1  ?>

</h2>
<?php $i 1;?>
<?php
$high_cat1 
get_option('repo_high_cat1');
$high_query = new WP_Query'category_name='.$high_cat1.'&posts_per_page=8' );
while ( 
$high_query->have_posts() ) : $high_query->the_post();
?>
<?php 
if($i == 1):?>

<div class="high-first-item">
<img class="highmage" src="<?php bloginfo('stylesheet_directory'); ?>/timthumb.php?src=<?php get_image_url(); ?>&amp;h=91&amp;w=146&amp;zc=1" alt="" />
<h3><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h3>
    <?php wpe_excerpt('wpe_excerptlength_slide''wpe_excerptmore'); ?>
</div>

<?php elseif($i 100 ):?>

<div class="high-rest-item">
<h3><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php echo short_title('...'5); ?></a></h3>
</div>
 <?php endif; ?>

 <?php $i++; ?>
<?php 
endwhile; ?>

</div>




<div class="high-box lbox"> <!-- #################  highlight category-2 #################### -->
<?php $high_cat2 get_option('repo_high_cat2'); ?>
<h2 class="high-cat"><?php echo $high_cat2 ?></h2>
<?php $i 2;?>
<?php
$high_cat2 
get_option('repo_high_cat2');
$high_query = new WP_Query'category_name='.$high_cat2.'&posts_per_page=8' );
while ( 
$high_query->have_posts() ) : $high_query->the_post();
?>
<?php 
if($i == 2):?>

<div class="high-first-item">
<img class="highmage" src="<?php bloginfo('stylesheet_directory'); ?>/timthumb.php?src=<?php get_image_url(); ?>&amp;h=91&amp;w=146&amp;zc=1" alt="" />
<h3><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h3>
    <?php wpe_excerpt('wpe_excerptlength_slide''wpe_excerptmore'); ?>
</div>

<?php elseif($i 100 ):?>

<div class="high-rest-item">
<h3><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php echo short_title('...'5); ?></a></h3>
</div>
 <?php endif; ?>

 <?php $i++; ?>
<?php 
endwhile; ?>

</div>




<div class="high-box lbox"> <!-- #################  highlight category-3 #################### -->
<?php $high_cat3 get_option('repo_high_cat3'); ?>
<h2 class="high-cat"><?php echo $high_cat3  ?>

</h2>
<?php $i 3;?>
<?php
$high_cat3 
get_option('repo_high_cat3');
$high_query = new WP_Query'category_name='.$high_cat3.'&posts_per_page=8' );
while ( 
$high_query->have_posts() ) : $high_query->the_post();
?>
<?php 
if($i == 3):?>

<div class="high-first-item">
<img class="highmage" src="<?php bloginfo('stylesheet_directory'); ?>/timthumb.php?src=<?php get_image_url(); ?>&amp;h=91&amp;w=146&amp;zc=1" alt="" />
<h3><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h3>
    <?php wpe_excerpt('wpe_excerptlength_slide''wpe_excerptmore'); ?>
</div>

<?php elseif($i 100 ):?>

<div class="high-rest-item">
<h3><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php echo short_title('...'5); ?></a></h3>
</div>
 <?php endif; ?>

 <?php $i++; ?>
<?php 
endwhile; ?>

</div>



<div class="high-box lbox"> <!-- #################  highlight category-4 #################### -->
<?php $high_cat4 get_option('repo_high_cat4'); ?>
<h2 class="high-cat"><?php echo $high_cat4 ?></h2>
<?php $i 4;?>
<?php
$high_cat4 
get_option('repo_high_cat4');
$high_query = new WP_Query'category_name='.$high_cat4.'&posts_per_page=8' );
while ( 
$high_query->have_posts() ) : $high_query->the_post();
?>
<?php 
if($i == 4):?>

<div class="high-first-item">
<img class="highmage" src="<?php bloginfo('stylesheet_directory'); ?>/timthumb.php?src=<?php get_image_url(); ?>&amp;h=91&amp;w=146&amp;zc=1" alt="" />
<h3><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h3>
    <?php wpe_excerpt('wpe_excerptlength_slide''wpe_excerptmore'); ?>
</div>

<?php elseif($i 100 ):?>

<div class="high-rest-item">
<h3><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php echo short_title('...'5); ?></a></h3>
</div>
 <?php endif; ?>

 <?php $i++; ?>
<?php 
endwhile; ?>

</div>



<div class="high-box rbox"> <!-- #################  highlight category-5 #################### -->
<?php $high_cat5 get_option('repo_high_cat5'); ?>
<h2 class="high-cat"><?php echo $high_cat5 ?></h2>
<?php $i 5;?>
<?php
$high_cat5 
get_option('repo_high_cat5');
$high_query = new WP_Query'category_name='.$high_cat5.'&posts_per_page=8' );
while ( 
$high_query->have_posts() ) : $high_query->the_post();
?>
<?php 
if($i == 5):?>

<div class="high-first-item">
<img class="highmage" src="<?php bloginfo('stylesheet_directory'); ?>/timthumb.php?src=<?php get_image_url(); ?>&amp;h=91&amp;w=146&amp;zc=1" alt="" />
<h3><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h3>
    <?php wpe_excerpt('wpe_excerptlength_slide''wpe_excerptmore'); ?>
</div>

<?php elseif($i 100 ):?>

<div class="high-rest-item">
<h3><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php echo short_title('...'5); ?></a></h3>
</div>
 <?php endif; ?>

 <?php $i++; ?>
<?php 
endwhile; ?>

</div>


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

<?php getpagenavi(); ?>


</div>

<?php get_sidebar(); ?>

<?php get_footer(); ?>