Advertisement
Guest User

Untitled

a guest
Jan 18th, 2019
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.92 KB | None | 0 0
  1. <?php
  2. /**
  3. * Template Name: Blog Grid
  4. * The main template file for display blog page.
  5. *
  6. * @package WordPress
  7. */
  8.  
  9. /**
  10. * Get Current page object
  11. **/
  12. $page = get_page($post->ID);
  13.  
  14. /**
  15. * Get current page id
  16. **/
  17.  
  18. if(!isset($current_page_id) && isset($page->ID))
  19. {
  20. $current_page_id = $page->ID;
  21. }
  22.  
  23. get_header();
  24. ?>
  25.  
  26. <br class="clear"/>
  27.  
  28. <?php
  29. $is_display_page_content = TRUE;
  30. $is_standard_wp_post = FALSE;
  31.  
  32. //Include custom header feature
  33. get_template_part("/templates/template-header");
  34. ?>
  35.  
  36. <div class="inner">
  37.  
  38. <!-- Begin main content -->
  39. <div class="inner_wrapper">
  40.  
  41. <div id="blog_grid_wrapper" class="sidebar_content full_width">
  42.  
  43.  
  44. <?php
  45.  
  46. global $more; $more = false;
  47.  
  48. $query_string ="post_type=post&paged=$paged";
  49. query_posts($query_string);
  50. $key = 0;
  51.  
  52. if (have_posts()) : while (have_posts()) : the_post();
  53.  
  54. $animate_layer = $key+7;
  55. $image_thumb = '';
  56.  
  57. if(has_post_thumbnail(get_the_ID(), 'large'))
  58. {
  59. $image_id = get_post_thumbnail_id(get_the_ID());
  60. $image_thumb = wp_get_attachment_image_src($image_id, 'large', true);
  61. }
  62. ?>
  63.  
  64. <!-- Begin each blog post -->
  65. <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  66.  
  67. <div class="post_wrapper grid_layout">
  68.  
  69. <?php
  70. //Get post featured content
  71. $post_ft_type = get_post_meta(get_the_ID(), 'post_ft_type', true);
  72.  
  73. switch($post_ft_type)
  74. {
  75. case 'Image':
  76. default:
  77. if(!empty($image_thumb))
  78. {
  79. $small_image_url = wp_get_attachment_image_src($image_id, 'blog', true);
  80. ?>
  81.  
  82. <div class="post_img small">
  83. <a href="<?php the_permalink(); ?>">
  84. <img src="<?php echo $small_image_url[0]; ?>" alt="" class="" style="width:<?php echo $small_image_url[1]; ?>px;height:<?php echo $small_image_url[2]; ?>px;"/>
  85. <div class="mask">
  86. <div class="mask_circle grid">
  87. <i class="fa fa-external-link"/></i>
  88. </div>
  89. </div>
  90. </a>
  91. </div>
  92.  
  93. <?php
  94. }
  95. break;
  96.  
  97. case 'Vimeo Video':
  98. $post_ft_vimeo = get_post_meta(get_the_ID(), 'post_ft_vimeo', true);
  99. ?>
  100. <?php echo do_shortcode('[tg_vimeo video_id="'.$post_ft_vimeo.'" width="670" height="377"]'); ?>
  101. <br/>
  102. <?php
  103. break;
  104.  
  105. case 'Youtube Video':
  106. $post_ft_youtube = get_post_meta(get_the_ID(), 'post_ft_youtube', true);
  107. ?>
  108. <?php echo do_shortcode('[tg_youtube video_id="'.$post_ft_youtube.'" width="670" height="377"]'); ?>
  109. <br/>
  110. <?php
  111. break;
  112.  
  113. case 'Gallery':
  114. $post_ft_gallery = get_post_meta(get_the_ID(), 'post_ft_gallery', true);
  115. ?>
  116. <?php echo do_shortcode('[tg_gallery_slider gallery_id="'.$post_ft_gallery.'" size="gallery_2" width="670" height="270"]'); ?>
  117. <?php
  118. break;
  119.  
  120. } //End switch
  121. ?>
  122.  
  123. <div class="blog_grid_content">
  124. <?php
  125. //Check post format
  126. $post_format = get_post_format(get_the_ID());
  127.  
  128. switch($post_format)
  129. {
  130. case 'quote':
  131. ?>
  132.  
  133. <i class="post_qoute_mark fa fa-quote-right grid"></i>
  134.  
  135. <div class="post_header quote">
  136. <div class="post_quote_title grid">
  137. <a href="<?php the_permalink(); ?>"><?php the_content(); ?></a>
  138.  
  139. <div class="post_detail">
  140. <?php echo _e( 'On', 'proxima-domain' ); ?>&nbsp;<?php echo get_the_time(THEMEDATEFORMAT); ?>&nbsp;
  141. <?php echo _e( 'And has', 'proxima-domain' ); ?>&nbsp;<a href="<?php comments_link(); ?>"><?php comments_number(__('No Comment', 'proxima-domain'), __('1 Comment', 'proxima-domain'), __('% Comments', 'proxima-domain')); ?></a>
  142. </div>
  143. </div>
  144. </div>
  145. <?php
  146. break;
  147.  
  148. case 'link':
  149. ?>
  150.  
  151. <i class="post_qoute_mark fa fa-link grid"></i>
  152.  
  153. <div class="post_header quote">
  154. <div class="post_quote_title grid">
  155. <?php the_content(); ?>
  156.  
  157. <div class="post_detail">
  158. <?php echo _e( 'On', 'proxima-domain' ); ?>&nbsp;<?php echo get_the_time(THEMEDATEFORMAT); ?>&nbsp;
  159. <?php echo _e( 'And has', 'proxima-domain' ); ?>&nbsp;<a href="<?php comments_link(); ?>"><?php comments_number(__('No Comment', 'proxima-domain'), __('1 Comment', 'proxima-domain'), __('% Comments', 'proxima-domain')); ?></a>
  160. </div>
  161. </div>
  162. </div>
  163. <?php
  164. break;
  165.  
  166. default:
  167. ?>
  168. <div class="post_header grid">
  169. <h6><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h6>
  170. <div class="post_detail">
  171. <?php echo _e( 'On', 'proxima-domain' ); ?>&nbsp;<?php echo get_the_time(THEMEDATEFORMAT); ?>&nbsp;
  172. <?php echo _e( 'And has', 'proxima-domain' ); ?>&nbsp;<a href="<?php comments_link(); ?>"><?php comments_number(__('No Comment', 'proxima-domain'), __('1 Comment', 'proxima-domain'), __('% Comments', 'proxima-domain')); ?></a>
  173. </div>
  174. </div>
  175.  
  176. <br class="clear"/>
  177.  
  178. <a href="<?php the_permalink(); ?>"><strong><?php echo _e( 'Read More', 'proxima-domain' ); ?></strong></a>
  179. <?php
  180. break;
  181. }
  182. ?>
  183. </div>
  184.  
  185. </div>
  186.  
  187. </div>
  188. <!-- End each blog post -->
  189.  
  190. <?php $key++; ?>
  191. <?php endwhile; endif; ?>
  192.  
  193. </div>
  194.  
  195. </div>
  196. <!-- End main content -->
  197. <?php
  198.  
  199. if($wp_query->max_num_pages > 1)
  200. {
  201. if (function_exists("wpapi_pagination"))
  202. {
  203. ?>
  204. <br class="clear"/><br/><br/>
  205. <?php
  206. wpapi_pagination($wp_query->max_num_pages);
  207. }
  208. else
  209. {
  210. ?>
  211. <div class="pagination"><p><?php posts_nav_link(' '); ?></p></div>
  212. <?php
  213. }
  214. ?>
  215.  
  216. <?php
  217. }
  218. ?>
  219.  
  220. </div>
  221. <br class="clear"/><br/>
  222. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement