Ver Mensaje Individual
  #4 (permalink)  
Antiguo 19/10/2007, 00:56
Avatar de _minimalnet_
_minimalnet_
 
Fecha de Ingreso: diciembre-2006
Ubicación: Valencia
Mensajes: 302
Antigüedad: 17 años, 4 meses
Puntos: 6
Re: Plugin que muestre entradas en el index pero no completas

A mano puedes hacerlo pero tendrías que modificar el template, la página index que es la portada.

A mi se me ocurre algo así, pero no funciona bien del todo, estoy muy verde en php, si alguien lo puede arreglar...

La idea en el ejemplo es mostrar primero 5 post y después 5 más, descontando los 5 q hay arriba, y eliminando el contenido.

Ah esto es una modificación del theme por defecto de wordpress.



Cita:
<?php get_header(); ?>

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

<?php if (have_posts()) : ?>
<?php query_posts('showposts=5'); ?>
<?php while (have_posts()) : the_post(); ?>

<div class="post" id="post-<?php the_ID(); ?>">
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
<small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small>

<div class="entry">
<?php the_content('Read the rest of this entry &raquo;'); ?>
</div>

<p class="postmetadata"><?php the_tags('Tags: ', ', ', '<br />'); ?> Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p>
</div>

<?php endwhile; ?>

<?php else : ?>

<h2 class="center">Not Found</h2>
<p class="center">Sorry, but you are looking for something that isn't here.</p>
<?php include (TEMPLATEPATH . "/searchform.php"); ?>

<?php endif; ?>












<?php if (have_posts()) : ?>
<?php query_posts('showposts=10'); ?>
<?php while (have_posts()) : the_post(); ?>
<?php $postCount++;
if ($postCount>5): ?>

<div class="post" id="post-<?php the_ID(); ?>">
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
<small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small>

<div class="entry">

</div>

<p class="postmetadata"><?php the_tags('Tags: ', ', ', '<br />'); ?> Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p>
</div>






<?php endif; ?>
<?php endwhile; else: ?>

<div class="navigation">
<div class="alignleft"><?php next_posts_link('&laquo; Older Entries') ?></div>
<div class="alignright"><?php previous_posts_link('Newer Entries &raquo;') ?></div>
</div>

<?php endif; ?>












</div>

<?php get_sidebar(); ?>

<?php get_footer(); ?>
Me encantaría poder ponerte el ejemplo y que funcione ya la perfección pero doy para más, me pierdo con los if, else y todo eso.
__________________
mi blog --> www.minimalnet.org