Guest User

Untitled

a guest
Jun 26th, 2014
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.03 KB | None | 0 0
  1. <?php
  2. global $loop_module_id, $loop_sidebar_position, $post;
  3.  
  4.  
  5. td_global::load_single_post($post);
  6.  
  7.  
  8. /* ----------------------------------------------------------------------------
  9. the post template (single article template)
  10. */
  11.  
  12. get_header();
  13.  
  14.  
  15. /* used by
  16. /includes/app/modules/module_modifier/td_module_blog.php
  17. /sidebar.php
  18. */
  19.  
  20.  
  21.  
  22. //set the template id, used to get the template specific settings
  23. $template_id = 'home'; //home = blog index = blog - use the same settings from the blog index
  24.  
  25. //prepare the loop variables
  26.  
  27. //read the global settings
  28. $loop_sidebar_position = td_util::get_option('tds_' . $template_id . '_sidebar_pos'); //sidebar right is default (empty)
  29. $loop_module_id = 1; //use the default 1 module (full post)
  30.  
  31.  
  32.  
  33. //print_r($td_post_theme_settings);
  34.  
  35. //read the primary category sidebar position! - we have to make the page after the primary category or after the global setting
  36. $primary_category_id = td_global::get_primary_category_id();
  37. if (!empty($primary_category_id)) {
  38. $tax_meta_sidebar = td_util::get_category_option($primary_category_id, 'tdc_sidebar_pos');//swich by RADU A, get_tax_meta($primary_category_id, 'tdc_sidebar_pos');
  39. if (!empty($tax_meta_sidebar)) {
  40. //update the sidebar position from the category setting
  41. $loop_sidebar_position = $tax_meta_sidebar;
  42. }
  43. }
  44.  
  45.  
  46. //read the custom single post settings - this setting overids all of them
  47. $td_post_theme_settings = get_post_meta($post->ID, 'td_post_theme_settings', true);
  48. if (!empty($td_post_theme_settings['td_sidebar_position'])) {
  49. $loop_sidebar_position = $td_post_theme_settings['td_sidebar_position'];
  50. }
  51.  
  52.  
  53. //increment the views counter
  54. td_page_views::update_page_views($post->ID);
  55.  
  56. switch ($loop_sidebar_position) {
  57. case 'sidebar_left':
  58. echo td_page_generator::wrap_start();
  59. ?>
  60. <div class="span4 column_container" role="complementary" itemscope="itemscope" itemtype="<?php echo td_global::$http_or_https?>://schema.org/WPSideBar">
  61. <?php get_sidebar(); ?>
  62. </div>
  63. <div class="span8 column_container" role="main" itemprop="mainContentOfPage">
  64. <?php
  65. locate_template('loop-single.php', true);
  66. comments_template('', true);
  67. ?>
  68. </div>
  69. <?php
  70. echo td_page_generator::wrap_end();
  71. break;
  72.  
  73. case 'no_sidebar':
  74. //td_global::$load_featured_img_from_template = 'art-slide-big';
  75. td_global::$load_featured_img_from_template = 'full';
  76. echo td_page_generator::wrap_start();
  77. ?>
  78. <div class="span12 column_container" role="main" itemprop="mainContentOfPage">
  79. <?php
  80. locate_template('loop-single.php', true);
  81. comments_template('', true);
  82. ?>
  83. </div>
  84. <?php
  85. echo td_page_generator::wrap_end();
  86. break;
  87.  
  88.  
  89.  
  90. default:
  91.  
  92. echo td_page_generator::wrap_start();
  93. ?>
  94. <div class="span12 post_title_full_width">
  95. <?php
  96.  
  97. $td_mod_single = new td_module_1($post);
  98.  
  99. //show the breadcrumb
  100. if (get_post_type($post) == 'page') {
  101. echo td_page_generator::get_single_breadcrumbs($td_mod_single->title);
  102. } else {
  103. echo td_page_generator::get_page_breadcrumbs($td_mod_single->title);
  104. }
  105. ?>
  106.  
  107. <article id="post-<?php echo $td_mod_single->post->ID;?>" class="<?php echo join(' ', get_post_class());?>" <?php echo $td_mod_single->get_item_scope();?>>
  108.  
  109. <header>
  110.  
  111. <?php echo $td_mod_single->get_title();?>
  112.  
  113. <div class="meta-info">
  114. <?php echo $td_mod_single->get_category();?>
  115. <?php //echo $td_mod_single->get_author();?>
  116. <?php echo $td_mod_single->get_date(false);?>
  117. <?php echo $td_mod_single->get_commentsAndViews();?>
  118. </div>
  119. </header>
  120.  
  121.  
  122. <?php if (!empty($td_mod_single->td_post_theme_settings['td_subtitle'])) { ?>
  123. <p class="td-sub-title"><?php echo $td_mod_single->td_post_theme_settings['td_subtitle'];?></p>
  124. <?php } ?>
  125.  
  126. </div>
  127. <?php
  128. echo td_page_generator::wrap_end();
  129.  
  130.  
  131. echo td_page_generator::wrap_start();
  132.  
  133.  
  134.  
  135. ?>
  136. <div class="span8 column_container" role="main" itemprop="mainContentOfPage">
  137. <?php
  138. locate_template('loop-single.php', true);
  139. comments_template('', true);
  140. ?>
  141. </div>
  142. <div class="span4 column_container" role="complementary" itemscope="itemscope" itemtype="<?php echo td_global::$http_or_https?>://schema.org/WPSideBar">
  143. <?php get_sidebar(); ?>
  144. </div>
  145. <?php
  146. echo td_page_generator::wrap_end();
  147. break;
  148. }
  149.  
  150. ?>
  151. </article> <!-- /.post -->
  152.  
  153. <?php
  154. get_footer();
Advertisement
Add Comment
Please, Sign In to add comment