Advertisement
Theodor_8

newspaper page_php

Jan 8th, 2015
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.20 KB | None | 0 0
  1. <?php
  2.  
  3. /* ----------------------------------------------------------------------------
  4.  
  5. the page template
  6.  
  7. */
  8.  
  9.  
  10.  
  11.  
  12.  
  13. get_header();
  14.  
  15.  
  16.  
  17.  
  18.  
  19. //set the template id, used to get the template specific settings
  20.  
  21. $template_id = 'page';
  22.  
  23.  
  24.  
  25.  
  26.  
  27. $loop_sidebar_position = td_util::get_option('tds_' . $template_id . '_sidebar_pos'); //sidebar right is default (empty)
  28.  
  29.  
  30.  
  31.  
  32.  
  33. //read the custom single post settings - this setting overids all of them
  34.  
  35. $td_page = get_post_meta($post->ID, 'td_page', true);
  36.  
  37. if (!empty($td_page['td_sidebar_position'])) {
  38.  
  39. $loop_sidebar_position = $td_page['td_sidebar_position'];
  40.  
  41. }
  42.  
  43.  
  44.  
  45. switch ($loop_sidebar_position) {
  46.  
  47. case 'sidebar_left':
  48.  
  49. echo td_page_generator::wrap_start();
  50.  
  51. ?>
  52.  
  53. <div class="span4 column_container" role="complementary" itemscope="itemscope" itemtype="<?php echo td_global::$http_or_https?>://schema.org/WPSideBar">
  54.  
  55. <?php get_sidebar(); ?>
  56.  
  57. </div>
  58.  
  59. <div class="span8 column_container td-no-pagination" role="main" itemscope="itemscope" itemprop="mainContentOfPage" itemtype="<?php echo td_global::$http_or_https?>://schema.org/CreativeWork">
  60.  
  61.  
  62.  
  63. <?php
  64.  
  65.  
  66.  
  67. if (have_posts()) {
  68.  
  69. while ( have_posts() ) : the_post();
  70.  
  71. echo td_page_generator::get_page_breadcrumbs(get_the_title());
  72.  
  73. ?>
  74.  
  75. <h1 itemprop="name" class="entry-title td-page-title">
  76.  
  77. <?php /*<a itemprop="url" href="<?php the_permalink()?>" rel="bookmark" title="<?php the_title_attribute() ?>"><?php the_title() ?></a>*/?>
  78.  
  79. <span><?php the_title() ?></span>
  80.  
  81. </h1>
  82.  
  83.  
  84.  
  85. <div class="td-page-text-content"><?php the_content();?></div>
  86.  
  87.  
  88.  
  89. <?php
  90.  
  91. if (td_util::get_option('tds_disable_comments_pages') == 'show_comments') {
  92.  
  93. comments_template('', true);
  94.  
  95. }
  96.  
  97. endwhile; //end loop
  98.  
  99. }
  100.  
  101. ?>
  102.  
  103.  
  104.  
  105. </div>
  106.  
  107. <?php
  108.  
  109. echo td_page_generator::wrap_end();
  110.  
  111. break;
  112.  
  113.  
  114.  
  115. case 'no_sidebar':
  116.  
  117. echo td_page_generator::wrap_start();
  118.  
  119. ?>
  120.  
  121. <div class="span12 column_container td-no-pagination" role="main" itemscope="itemscope" itemprop="mainContentOfPage" itemtype="<?php echo td_global::$http_or_https?>://schema.org/CreativeWork">
  122.  
  123.  
  124.  
  125. <?php
  126.  
  127. if (have_posts()) {
  128.  
  129. while ( have_posts() ) : the_post();
  130.  
  131. echo td_page_generator::get_page_breadcrumbs(get_the_title());
  132.  
  133. ?>
  134.  
  135. <h1 itemprop="name" class="entry-title td-page-title">
  136.  
  137. <?php /*<a itemprop="url" href="<?php the_permalink()?>" rel="bookmark" title="<?php the_title_attribute() ?>"><?php the_title() ?></a>*/?>
  138.  
  139. <span><?php the_title() ?></span>
  140.  
  141. </h1>
  142.  
  143.  
  144.  
  145. <div class="td-page-text-content"><?php the_content();?></div>
  146.  
  147.  
  148.  
  149. <?php
  150.  
  151. if (td_util::get_option('tds_disable_comments_pages') == 'show_comments') {
  152.  
  153. comments_template('', true);
  154.  
  155. }
  156.  
  157. endwhile; //end loop
  158.  
  159. }
  160.  
  161. ?>
  162.  
  163.  
  164.  
  165. </div>
  166.  
  167. <?php
  168.  
  169. echo td_page_generator::wrap_end();
  170.  
  171. break;
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179. default:
  180.  
  181. echo td_page_generator::wrap_start();
  182.  
  183. ?>
  184.  
  185. <div class="span8 column_container td-no-pagination" role="main" itemscope="itemscope" itemprop="mainContentOfPage" itemtype="<?php echo td_global::$http_or_https?>://schema.org/CreativeWork">
  186.  
  187. <?php
  188.  
  189. if (have_posts()) {
  190.  
  191. while ( have_posts() ) : the_post();
  192.  
  193. echo td_page_generator::get_page_breadcrumbs(get_the_title());
  194.  
  195. ?>
  196.  
  197. <h1 itemprop="name" class="entry-title td-page-title">
  198.  
  199. <?php /*<a itemprop="url" href="<?php the_permalink()?>" rel="bookmark" title="<?php the_title_attribute() ?>"><?php the_title() ?></a>*/?>
  200.  
  201. <span><?php the_title() ?></span>
  202.  
  203. </h1>
  204.  
  205.  
  206.  
  207. <div class="td-page-text-content"><?php the_content();?></div>
  208.  
  209.  
  210.  
  211. <?php
  212.  
  213. if (td_util::get_option('tds_disable_comments_pages') == 'show_comments') {
  214.  
  215. comments_template('', true);
  216.  
  217. }
  218.  
  219. endwhile;//end loop
  220.  
  221. }
  222.  
  223. ?>
  224.  
  225. </div>
  226.  
  227. <div class="span4 column_container" role="complementary" itemscope="itemscope" itemtype="<?php echo td_global::$http_or_https?>://schema.org/WPSideBar">
  228.  
  229. <?php get_sidebar(); ?>
  230.  
  231. </div>
  232.  
  233. <?php
  234.  
  235. echo td_page_generator::wrap_end();
  236.  
  237. break;
  238.  
  239. }
  240.  
  241.  
  242.  
  243.  
  244.  
  245. get_footer();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement