Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 
 
 

78 wiersze
2.5 KiB

  1. <?php get_header() ?>
  2. <?php if ( have_posts() ) { ?>
  3. <section id="content" class="articles wrapper container">
  4. <header <?php post_class('section-header'); ?>>
  5. <h1 class="title"><?php echo get_the_title(get_option('page_for_posts')); ?></h1>
  6. </header>
  7. <?php
  8. /*
  9. * @Sidebar Content before
  10. */
  11. get_sidebar('content-before'); ?>
  12. <div class="inner">
  13. <?php while ( have_posts() ) : the_post() ?>
  14. <?php
  15. $post_type = get_post_type();
  16. $post_meta = get_post_custom();
  17. $more_text = sandbox_get_more_text($post_type, $post_meta);
  18. // echo var_dump(!empty($customPostsMeta["_custom_more_text"]));
  19. $excerpt = apply_filters('the_content', has_excerpt() ? get_the_excerpt() : wp_trim_words(get_the_content(), 40));
  20. // post thumbnail as background image
  21. $thumbnail_style = '';
  22. if ( has_post_thumbnail() ) {
  23. $thumbnail_style = ' style="background-image:url(' . get_the_post_thumbnail_url($post_id, 'full') . ');"';
  24. }
  25. ?>
  26. <article id="post-<?php the_ID() ?>" <?php post_class(); ?>>
  27. <div class="inner">
  28. <?php if ( has_post_thumbnail() ) { ?>
  29. <a href="<?php the_permalink() ?>" class="post-thumbnail"<?php echo $thumbnail_style; ?>><?php the_post_thumbnail('sandbox-default'); ?></a>
  30. <?php } ?>
  31. <div class="content">
  32. <h2 class="title"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
  33. <?php echo $excerpt; ?>
  34. <a class="button" href="<?php the_permalink() ?>"><?php printf($more_text); ?></a>
  35. <?php if ( $meta = sandbox_get_meta_data(array('rtime', 'date', 'author', 'terms')) ) { ?>
  36. <ul class="meta">
  37. <?php echo $meta; ?>
  38. </ul>
  39. <?php } ?>
  40. </div>
  41. </div>
  42. </article><!-- .post -->
  43. <?php endwhile; ?>
  44. <?php if ( function_exists('wp_pagenavi') ) {
  45. wp_pagenavi(); // http://wordpress.org/plugins/wp-pagenavi/
  46. } else {
  47. ?>
  48. <nav id="nav-below" class="navigation">
  49. <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&laquo;</span> Older results', 'sandbox' ) ) ?></div>
  50. <div class="nav-next"><?php previous_posts_link( __( 'Newer results <span class="meta-nav">&raquo;</span>', 'sandbox' ) ) ?></div>
  51. </nav>
  52. <?php } ?>
  53. </div>
  54. <?php
  55. /*
  56. * @Sidebar Content after
  57. */
  58. get_sidebar('content-after'); ?>
  59. </section>
  60. <?php } ?>
  61. <?php get_footer() ?>