fork download
  1. <?php
  2. /*
  3. Template Name: Home Page - Style 1
  4. */
  5. ?>
  6. <?php get_header(); ?>
  7. <div class="row">
  8. <section class="fullwidth twelve columns">
  9. <div id="featured" class="carousel owl row" data-columns="4" data-navigation="true" data-autoplay="false">
  10. <?php $args = array(
  11. 'order' => 'DESC',
  12. 'posts_per_page' => '10',
  13. 'tag__in' => ot_get_option('featured_news')
  14. );
  15. ?>
  16. <?php $query = new WP_Query($args); ?>
  17. <?php if ($query->have_posts()) : while ($query->have_posts()) : $query->the_post(); ?>
  18. <?php $category = thb_GetSingleCategory();
  19. $color = GetCategoryColor($category); ?>
  20. <article>
  21. <?php the_post_thumbnail('featured', array('class' => 'hidden')); ?>
  22. <div class="post front">
  23. <div class="post-gallery">
  24. <?php the_post_thumbnail('featured'); ?>
  25. <div class="overlay"></div>
  26. </div>
  27. <div class="post-title">
  28. <aside><?php echo thb_DisplaySingleCategory(); ?></aside>
  29. <h2><a href="<?php the_permalink() ?>" rel="bookmark"><?php echo ShortenText(get_the_title(), 50); ?></a></h2>
  30. <?php echo thb_DisplayPostMeta(true,true,true, false); ?>
  31. </div>
  32. </div>
  33. <div class="post back" style="border-color: <?php echo $color ?>;">
  34. <div class="post-title">
  35. <aside><?php echo thb_DisplaySingleCategory(); ?></aside>
  36. <h2><a href="<?php the_permalink() ?>" rel="bookmark"><?php echo ShortenText(get_the_title(), 50); ?></a></h2>
  37. <div class="post-content">
  38. <p><?php echo ShortenText(get_the_excerpt(), 50); ?></p>
  39. <a class="readmore" href="<?php the_permalink() ?>"><?php _e( 'Read More', THB_THEME_NAME ); ?></a>
  40. <?php echo thb_DisplayPostMeta(true,true,true,false); ?>
  41. </div>
  42. </div>
  43.  
  44. </div>
  45. </article>
  46. <?php endwhile; else: endif; ?>
  47. </div>
  48. </section>
  49. <section class="seven columns main-container">
  50. <div id="slider" class="flex slider flex-start" data-bullets="true" data-controls="true">
  51. <ul class="slides">
  52. <?php $args = array(
  53. 'posts_per_page' => '5',
  54. 'ignore_sticky_posts' => '1',
  55. 'no_found_rows' => true
  56. );
  57. ?>
  58. <?php $query = new WP_Query($args); ?>
  59. <?php if ($query->have_posts()) : while ($query->have_posts()) : $query->the_post(); ?>
  60. <li class="post">
  61. <div class="post-gallery">
  62. <a href="<?php the_permalink() ?>" rel="bookmark"><?php the_post_thumbnail('slider'); ?></a>
  63. <div class="overlay"></div>
  64. </div>
  65. <div class="post-title">
  66. <aside><?php echo thb_DisplaySingleCategory(); ?></aside>
  67. <h2><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2>
  68. <?php echo thb_DisplayPostMeta(true,true,true,true); ?>
  69. </div>
  70. </li>
  71. <?php endwhile; else: ?>
  72. <li>
  73. <?php _e( 'No Posts to display', THB_THEME_NAME ); ?>
  74. </li>
  75. <?php endif; ?>
  76. </ul>
  77. </div>
  78. <section id="recentnews">
  79. <div class="headline"><h2><?php _e( 'Recent News', THB_THEME_NAME ); ?></h2></div>
  80. <?php $args = array(
  81. 'posts_per_page' => '5',
  82. 'offset' => '5',
  83. 'ignore_sticky_posts' => '1'
  84. );
  85. ?>
  86. <?php $query = new WP_Query($args); ?>
  87. <?php if ($query->have_posts()) : while ($query->have_posts()) : $query->the_post(); ?>
  88. <article class="post">
  89. <div class="row">
  90. <div class="five columns">
  91. <div class="post-gallery">
  92. <a href="<?php the_permalink() ?>" rel="bookmark"><?php the_post_thumbnail('recent'); ?></a>
  93. <?php echo thb_DisplayImageTag(get_the_ID()); ?>
  94. </div>
  95. </div>
  96. <div class="seven columns">
  97. <div class="post-title">
  98. <aside><?php echo thb_DisplaySingleCategory(false); ?></aside>
  99. <h2><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2>
  100. </div>
  101. <div class="post-content">
  102. <p><?php echo ShortenText(get_the_excerpt(), 150); ?></p>
  103. <?php echo thb_DisplayPostMeta(true,true,true,false); ?>
  104. </div>
  105. </div>
  106. </div>
  107. </article>
  108. <?php endwhile; else: ?>
  109. <article>
  110. <?php _e( 'Please select tags from your Theme Options Page', THB_THEME_NAME ); ?>
  111. </article>
  112. <?php endif; ?>
  113. <a id="loadmore" href="#" data-loading="<?php _e( 'Loading ...', THB_THEME_NAME ); ?>" data-nomore="<?php _e( 'No More Posts to Show', THB_THEME_NAME ); ?>" data-count="5" data-action="thb_ajax_home"><?php _e( 'Load More', THB_THEME_NAME ); ?></a>
  114. </section>
  115. <section class="categorynews">
  116. <?php $categories = thb_HomePageCategories();?>
  117.  
  118. <?php foreach($categories as $category) { ?>
  119. <?php $color = GetCategoryColor($category); ?>
  120. <div class="categoryholder cf">
  121. <div class="categoryheadline" style="border-color:<?php echo $color; ?>">
  122. <h2><?php $cat = get_category($category); echo $cat->name; ?></h2>
  123. <span><a href="<?php echo get_category_link($category); ?>" style="color:<?php echo $color; ?>"><?php _e( '<i class="icon-long-arrow-right"></i> View All Articles', THB_THEME_NAME ); ?></a></span>
  124. </div>
  125. <?php $args = array(
  126. 'posts_per_page' => '5',
  127. 'category__in' => $category,
  128. 'no_found_rows' => true
  129. );
  130. ?>
  131. <?php $query = new WP_Query($args); $i = 0;?>
  132. <div class="row">
  133. <?php if ($query->have_posts()) : while ($query->have_posts()) : $query->the_post(); ?>
  134.  
  135. <?php if ($i == 0) { ?>
  136. <article class="post five columns">
  137. <div class="post-gallery">
  138. <a href="<?php the_permalink() ?>" rel="bookmark"><?php the_post_thumbnail('recent'); ?></a>
  139. <?php echo thb_DisplayImageTag(get_the_ID()); ?>
  140. </div>
  141. <div class="post-title">
  142. <h2><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2>
  143. </div>
  144. <div class="post-content">
  145. <p><?php echo ShortenText(get_the_excerpt(), 150); ?></p>
  146. <?php echo thb_DisplayPostMeta(true,true,true,false); ?>
  147. </div>
  148. </article>
  149. <?php } else { ?>
  150. <div class="seven columns">
  151. <article class="post cf side">
  152. <div class="post-gallery mobile-one left">
  153. <a href="<?php the_permalink() ?>" rel="bookmark"><?php the_post_thumbnail(); ?></a>
  154. </div>
  155. <div class="post-title mobile-three left">
  156. <h2><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2>
  157. <?php echo thb_DisplayPostMeta(true,true,true,false); ?>
  158. </div>
  159. </article>
  160. </div>
  161. <?php } ?>
  162.  
  163. <?php $i++; ?>
  164. <?php endwhile; else: endif; ?>
  165. </div>
  166. </div> <!-- End Category -->
  167. <?php } ?>
  168. </section>
  169. </section>
  170. <?php get_sidebar('left'); ?>
  171. <?php get_sidebar('right'); ?>
  172. </div>
  173. <?php get_footer(); ?>
Runtime error #stdin #stdout #stderr 0.02s 20520KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
PHP Fatal error:  Call to undefined function get_header() in /home/yFP9kx/prog.php on line 6