Advertisement
Avi

LOOP/ show category in home

Avi
Sep 8th, 2011
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. <?php if (!have_posts()) : ?>
  2. <?php if ( is_home() ) { $cat_id = get_cat_ID('Adicional'); } ?>
  3. <div id="post-0" class="hentry post error404 not-found">
  4. <div class="title">
  5. <h2>No encontrado</h2>
  6. </div>
  7. <div class="content">
  8. <p>Disculpa pero el resultado no fue encontrado. Quizá usar la barra de búsqueda ayude a encontrar temas relacionados.</p>
  9. </div>
  10. </div>
  11.  
  12. <?php else : ?>
  13. <?php add_filter('excerpt_length', 'padd_theme_hook_excerpt_index_length'); ?>
  14. <?php $i = 1; ?>
  15.  
  16. <?php while (have_posts()) : ?>
  17. <?php the_post(); ?>
  18. <div id="post-<?php the_ID(); ?>" <?php post_class('append-clear hentry-' . $i ); ?>>
  19. <div class="title">
  20. <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
  21. </div>
  22. <div class="thumbnail">
  23. <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">
  24. <?php
  25. $padd_image_def = get_template_directory_uri() . '/images/thumbnail.jpg';
  26. if (has_post_thumbnail()) {
  27. the_post_thumbnail(PADD_THEME_SLUG . '-thumbnail');
  28. } else {
  29. echo '<img class="image-thumbnail" alt="Default thumbnail." src="' . $padd_image_def . '" />';
  30. }
  31. ?>
  32. </a>
  33. </div>
  34. <div class="excerpt">
  35. <?php the_excerpt();?>
  36. </div>
  37. <?php
  38. if (3 == $i) {
  39. $i = 1;
  40. } else {
  41. $i++;
  42. }
  43. ?>
  44. </div>
  45. <?php remove_filter('excerpt_length', 'padd_theme_hook_excerpt_index_length'); ?>
  46. <?php endwhile; ?>
  47.  
  48. <?php Padd_PageNavigation::render(); ?>
  49.  
  50. <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement