Ver Mensaje Individual
  #6 (permalink)  
Antiguo 06/05/2013, 02:35
Avatar de zanguanga
zanguanga
Moderadora
 
Fecha de Ingreso: julio-2009
Ubicación: España
Mensajes: 1.686
Antigüedad: 15 años, 8 meses
Puntos: 429
Respuesta: Plugin programar post

Hay un código que puede servirte:

Código PHP:
Ver original
  1. <div id="futura-entrada">
  2.     <div id="futura_cabecera"><p>Proximamente</p></div>
  3.     <?php query_posts('showposts=10&post_status=future'); ?>
  4.     <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
  5.         <div >
  6.             <p class><b><?php the_title(); ?></b><?php edit_post_link('e',' (',')'); ?><br />
  7.             <span class="datetime"><?php the_time('j. F Y'); ?></span></p>
  8.         </div>
  9.     <?php endwhile; else: ?><p>No hay entradas programadas.</p><?php endif; ?>
  10. </div>

o

Código PHP:
Ver original
  1. <?php
  2. $my_query = new WP_Query('post_status=future&order=DESC&showposts=5');
  3. if ($my_query->have_posts()) {
  4.     while ($my_query->have_posts()) : $my_query->the_post(); ?>
  5.         <li><?php the_title(); ?></li>
  6.     <?php endwhile;
  7. }
  8. ?>

El código para poner el tiempo como "hace tantos días" es este, para el pasado funciona perfectamente, para el futuro no lo sé, si lo pruebas nos dices

Código HTML:
Ver original
  1. <li>Publicado hace <?php echo human_time_diff(get_the_time('U'), current_time('timestamp')) . ' '; ?></li>
__________________
Mi blog personal | Mi G+