Foro de elhacker.net

Programación => PHP => Mensaje iniciado por: KlaHavoK en 19 Noviembre 2013, 20:27 pm



Título: Duda con PHP y Posts de Wordpress!!
Publicado por: KlaHavoK en 19 Noviembre 2013, 20:27 pm
Hola a todos!!  ::)

Le estoy arreglando la web a un cliente. Le creé un blog en wordpress, y creé una sección de noticias donde a través del código siguiente:

Código
  1. <?php
  2. require_once($_SERVER [ 'DOCUMENT_ROOT'].'/blog/wp-config.php');
  3. $my_query = new WP_Query('showposts=5');
  4. while ($my_query->have_posts()) : $my_query->the_post();
  5. $do_not_duplicate = $post->ID;
  6. ?>
  7.  
  8. <li>
  9. <div id="big_wrapper">
  10. <div id="wrapper">
  11. <div id="cell">
  12. <div class="content">
  13. <?php the_post_thumbnail('medium'); ?>
  14. </div>
  15. </div>
  16. </div>
  17.  
  18.    <div class="noticia">
  19.     <span id="titulo"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></span><br>
  20.     <span id="time"><?php the_time('j') ?>/<?php the_time('M') ?>/<?php the_time('Y') ?></span><br>
  21.     <span id="contenido"><?php the_excerpt(); ?></span><br>
  22.     <span id="ver_mas" style="float: right;"><a href="<?php the_permalink() ?>">VER MÁS ></a></span>
  23.    </div>
  24. </li>
  25. </div>
  26.  
  27. <?php posts_nav_link('separator','prelabel','nextlabel'); ?>
  28.  
  29. <?php endwhile;?>

convierto los posts en noticias. Mi pregunta es la siguiente:

Actualmente está trayendo 5 posts, y quisiera que me permitiera también traer los 5 posts siguientes, haciendo click en "Posts Mas antiguos" (como normalmente es en Wordpress). Cómo podría lograr eso?

Mil gracias a los que me puedan ayudar ; _ ;