PageRenderTime 26ms CodeModel.GetById 21ms RepoModel.GetById 1ms app.codeStats 0ms

/single.php

https://gitlab.com/farkbarn/hcudamp
PHP | 176 lines | 63 code | 2 blank | 111 comment | 4 complexity | a21ebf29b98030aed8d87b30037c57a9 MD5 | raw file
  1. <?php
  2. /*
  3. Template Name: Single post
  4. */
  5. get_header();
  6. setPostViews(get_the_ID());
  7. ?>
  8. <div class="theme_page relative">
  9. <div class="page_layout page_margin_top clearfix">
  10. <div class="page_header clearfix">
  11. <div class="page_header_left">
  12. <h1 class="page_title"><?php the_title(); ?></h1>
  13. <ul class="bread_crumb">
  14. <li>
  15. <a href="<?php echo get_home_url(); ?>" title="<?php _e('Home', 'medicenter'); ?>">
  16. <?php _e('Home', 'medicenter'); ?>
  17. </a>
  18. </li>
  19. <li class="separator icon_small_arrow right_gray">
  20. &nbsp;
  21. </li>
  22. <li>
  23. <?php the_title(); ?>
  24. </li>
  25. </ul>
  26. </div>
  27. <?php
  28. /*get page with single post template set*/
  29. $post_template_page_array = get_pages(array(
  30. 'post_type' => 'page',
  31. 'post_status' => 'publish',
  32. //'number' => 1,
  33. 'meta_key' => '_wp_page_template',
  34. 'meta_value' => 'single.php'
  35. ));
  36. $post_template_page = $post_template_page_array[0];
  37. $sidebar = get_post(get_post_meta($post_template_page->ID, "page_sidebar_header", true));
  38. if(!(int)get_post_meta($sidebar->ID, "hidden", true) && is_active_sidebar($sidebar->post_name)):
  39. ?>
  40. <div class="page_header_right">
  41. <?php
  42. dynamic_sidebar($sidebar->post_name);
  43. ?>
  44. </div>
  45. <?php
  46. endif;
  47. ?>
  48. </div>
  49. <div class="clearfix">
  50. <?php
  51. if(count($post_template_page_array) && isset($post_template_page))
  52. {
  53. echo wpb_js_remove_wpautop(apply_filters('the_content', $post_template_page->post_content));
  54. global $post;
  55. $post = $post_template_page;
  56. setup_postdata($post);
  57. }
  58. else
  59. echo wpb_js_remove_wpautop(apply_filters('the_content', '[vc_row top_margin="none" el_position="first last"] [vc_column top_margin="none" width="2/3"] [single_post featured_image_size="default" columns="1" show_post_categories="1" show_post_author="1" comments="1" lightbox_icon_color="blue_light" el_position="first last"] [/vc_column] [vc_column top_margin="none" width="1/3"] [vc_widget_sidebar sidebar_id="sidebar-blog" top_margin="page_margin_top" el_position="first"] [box_header title="Photostream" type="h3" bottom_border="1" top_margin="page_margin_top_section"] [photostream id="photostream" images="21,15,16,17,18,19" featured_image_size="default" lightbox_icon_color="blue_light" images_loop="1" top_margin="none"] [vc_widget_sidebar sidebar_id="sidebar-blog-2" top_margin="page_margin_top_section" el_position="last"] [/vc_column] [/vc_row]'));
  60. ?>
  61. </div>
  62. </div>
  63. </div>
  64. <?php
  65. get_footer();
  66. ?>
  67. <?php
  68. /*
  69. get_header();
  70. setPostViews(get_the_ID());
  71. ?>
  72. <div class="theme_page relative">
  73. <div class="page_layout clearfix">
  74. <div class="page_header clearfix">
  75. <div class="page_header_left">
  76. <h1><?php the_title(); ?></h1>
  77. <h4><?php echo get_post_meta(get_the_ID(), $themename. "_subtitle", true); ?></h4>
  78. </div>
  79. <div class="page_header_right">
  80. <?php
  81. get_sidebar('header');
  82. ?>
  83. </div>
  84. </div>
  85. <ul class="bread_crumb clearfix">
  86. <li>You are here:</li>
  87. <li>
  88. <a href="<?php echo get_home_url(); ?>" title="<?php _e('Home', 'gymbase'); ?>">
  89. <?php _e('Home', 'gymbase'); ?>
  90. </a>
  91. </li>
  92. <li class="separator icon_small_arrow right_white">
  93. &nbsp;
  94. </li>
  95. <li>
  96. <?php the_title(); ?>
  97. </li>
  98. </ul>
  99. <div class="page_left">
  100. <ul class="blog clearfix">
  101. <?php
  102. if(have_posts()) : while (have_posts()) : the_post();
  103. ?>
  104. <li <?php post_class('class'); ?>>
  105. <div class="comment_box">
  106. <div class="first_row">
  107. <?php the_time("d"); ?><span class="second_row"><?php echo strtoupper(date_i18n("M", get_the_time())); ?></span>
  108. </div>
  109. <a class="comments_number" href="<?php comments_link(); ?>" title="<?php comments_number('0 ' . __('Comments', 'gymbase')); ?>">
  110. <?php comments_number('0 ' . __('Comments', 'gymbase')); ?>
  111. </a>
  112. </div>
  113. <div class="post_content">
  114. <?php
  115. if(has_post_thumbnail()):
  116. $attachment_image = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), "large");
  117. $large_image_url = $attachment_image[0];
  118. ?>
  119. <a class="post_image fancybox" href="<?php echo $large_image_url; ?>" title="<?php the_title(); ?>">
  120. <?php the_post_thumbnail("blog-post-thumb", array("alt" => get_the_title(), "title" => "")); ?>
  121. </a>
  122. <?php
  123. endif;
  124. ?>
  125. <h2>
  126. <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
  127. <?php the_title(); ?>
  128. </a>
  129. </h2>
  130. <div class="text">
  131. <?php the_content(); ?>
  132. </div>
  133. <div class="post_footer">
  134. <ul class="categories">
  135. <li class="posted_by"><?php _e('Posted by', 'gymbase'); echo " "; if(get_the_author_meta("user_url")!=""):?><a class="author" href="<?php the_author_meta("user_url"); ?>" title="<?php the_author(); ?>"><?php the_author(); ?></a><?php else: the_author(); endif; ?></li>
  136. <?php
  137. $categories = get_the_category();
  138. foreach($categories as $key=>$category)
  139. {
  140. ?>
  141. <li>
  142. <a href="<?php echo get_category_link($category->term_id ); ?>" title="<?php echo (empty($category->description) ? sprintf(__('View all posts filed under %s', 'gymbase'), $category->name) : esc_attr(strip_tags(apply_filters('category_description', $category->description, $category)))); ?>">
  143. <?php echo $category->name; ?>
  144. </a>
  145. </li>
  146. <?php
  147. }
  148. ?>
  149. </ul>
  150. </div>
  151. </div>
  152. </li>
  153. <?php
  154. endwhile; endif;
  155. ?>
  156. </ul>
  157. <?php
  158. comments_template();
  159. require_once("comments-form.php");
  160. ?>
  161. </div>
  162. <div class="page_right">
  163. <?php
  164. if(is_active_sidebar('blog'))
  165. get_sidebar('blog');
  166. ?>
  167. </div>
  168. </div>
  169. </div>
  170. <?php
  171. get_footer();
  172. */
  173. ?>