index.php 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <?php get_header(); ?>
  2. <div id="wrapper" class="clearfix">
  3. <div id="featured-wrapper">
  4. <?php
  5. $counter = 0;
  6. $featuredPosts = new WP_Query( 'category_name=featured&posts_per_page=6' );
  7. while ( $featuredPosts->have_posts() ) : $featuredPosts->the_post();
  8. if(($counter % 3) == 0) {
  9. ?>
  10. <div class="row">
  11. <?php
  12. }
  13. if($counter == 0 || $counter == 5) {
  14. ?>
  15. <div class="col-md-6">
  16. <div class="image-wrapper">
  17. <a href="<?php the_permalink(); ?>">
  18. <?php the_post_thumbnail('featured-wide', array("class" => "img-responsive zoom-image")); ?>
  19. </a>
  20. </div>
  21. <div class="featured-meta">
  22. <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
  23. <span class="post-author">
  24. <i class="fa fa-user fa-fw"></i><span itemprop="author"><?php the_author(); ?></span>
  25. </span>
  26. <span class="post-date">
  27. <i class="fa fa-clock-o fa-fw"></i><span itemprop="dateCreated"><?php the_date(); ?></span>
  28. </span>
  29. <span class="post-categories">
  30. <i class="fa fa-folder fa-fw"></i><span itemprop="keywords"><?php the_category(', '); ?></span>
  31. </span>
  32. </div>
  33. </div>
  34. <?php
  35. } else {
  36. ?>
  37. <div class="col-md-3">
  38. <div class="image-wrapper">
  39. <a href="<?php the_permalink(); ?>">
  40. <?php the_post_thumbnail('featured', array("class" => "img-responsive zoom-image")); ?>
  41. </a>
  42. </div>
  43. <div class="featured-meta">
  44. <h4><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4>
  45. </div>
  46. </div>
  47. <?php
  48. }
  49. if($counter == 2 || $counter == 5) {
  50. ?>
  51. </div>
  52. <?php
  53. }
  54. $counter++;
  55. endwhile;
  56. ?>
  57. </div>
  58. <div id="content">
  59. <div class="col-md-8">
  60. <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
  61. <div itemscope="itemscope" itemtype="http://schema.org/NewsArticle" class="post clearfix">
  62. <?php
  63. if(has_post_thumbnail()) {
  64. ?>
  65. <div class="post-image pull-left">
  66. <div class="image-wrapper">
  67. <a href="<?php the_permalink(); ?>">
  68. <?php the_post_thumbnail(array(300,200), array("itemprop" => "thumbnailUrl", "alt" => "yolo")); ?>
  69. </a>
  70. </div>
  71. </div>
  72. <?php
  73. }
  74. ?>
  75. <div class="post-content pull-left">
  76. <h2 itemprop="headline" class="post-title">
  77. <a href="<?php the_permalink(); ?>">
  78. <?php the_title(); ?>
  79. </a>
  80. </h2>
  81. <div class="post-meta text-muted">
  82. <span class="post-author">
  83. <i class="fa fa-user fa-fw"></i><span itemprop="author"><?php the_author(); ?></span>
  84. </span>
  85. <span class="post-date">
  86. <i class="fa fa-clock-o fa-fw"></i><span itemprop="dateCreated"><?php the_date(); ?></span>
  87. </span>
  88. <span class="post-categories">
  89. <i class="fa fa-folder fa-fw"></i><span itemprop="keywords"><?php the_category(', '); ?></span>
  90. </span>
  91. </div>
  92. <div itemprop="articleBody" class="post-excerpt">
  93. <?php the_excerpt(); ?>
  94. </div>
  95. </div>
  96. </div>
  97. <?php endwhile; endif; ?>
  98. </div>
  99. <div class="col-md-4 sidebar">
  100. <?php get_sidebar(); ?>
  101. </div>
  102. </div>
  103. </div>
  104. <?php get_footer(); ?>