Text Resizer Text Resizer
February 7th, 2012
You're browsing: Scriptmatico.Com » CSS,Diseño,WordPress » Paginar artículos recientes en WordPress

Paginar artículos recientes en WordPress

Posted on may 01 in CSS, Diseño, WordPressby PrintText Resizer Text Resizer

Para aquellos que siempre están pensando en agregar cosas nuevas a sus diseños de wordpress, acabo de ver este agradable tip para generar paginación con nuestros articulos recientes.

Ver demo en raproject - Pagina del Artículo weblogtoolscollection

PHP:
  1. <div id="recientespag">
  2. <h3>Articulos Recientes</h3>
  3. <ul>
  4. <?php
  5. $temp = $wp_query;
  6. $wp_query= null;
  7. $wp_query = new WP_Query();
  8. $wp_query->query('showposts=5'.'&paged='.$paged);
  9. ?>
  10. <?php while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
  11.     <li><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></li>
  12. <?php endwhile; ?>
  13. </ul>
  14. <div class="navigation">
  15.   <div class="alignleft"><?php previous_posts_link('« Otros') ?></div>
  16.   <div class="alignright"><?php next_posts_link('Leer Mas »') ?></div>
  17. </div>
  18. <?php $wp_query = null; $wp_query = $temp;?>
  19. </div>

Y agregando un poco de CSS:

CSS:
  1. #recientespag {
  2. width:300px;
  3. background: #1B1B19;
  4. border: 1px solid #2A2A2A;
  5. float:right;
  6. padding:13px 15px 8px 15px;
  7. }
  8. #recientespag h3 {
  9. font-family: Georgia, "Times New Roman", Times, serif;
  10. font-size: 2.2em;
  11. color: #C7C54F;
  12. }
  13. #recientespag ul {
  14. margin-top:-5px;
  15. }
  16. #recientespag li {
  17. border-bottom:1px solid #2A2A2A;
  18. list-style:none;
  19. padding:7px 0 7px 0px;
  20. }
  21. #recientespag a, #recent a:visited {
  22. color:#999831;
  23. font-size:0.9em;
  24. font-family: Verdana, Arial, Helvetica, sans-serif;
  25. }

Con todo ese codigo nos quedaria un diseño similar a la imagen que puse arriba del Post.

Related posts:

  1. Error 1075 MYSQl

Leave a Reply

You must be logged in to post a comment.

Back to Top