Guest User

Untitled

a guest
Oct 6th, 2014
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.84 KB | None | 0 0
  1. <?php
  2. /* ----------------------------------------------------------------------------
  3. the blog index template
  4. */
  5.  
  6. get_header();
  7.  
  8. global $loop_module_id, $loop_sidebar_position, $cur_cat_obj;
  9.  
  10. $cur_cat_id = get_query_var('cat');
  11. $cur_cat_obj = get_category($cur_cat_id);
  12.  
  13.  
  14. //read the per category setting
  15. $tdc_layout = td_util::get_category_option($cur_cat_id, 'tdc_layout');//swich by RADU A, get_tax_meta($cur_cat_id, 'tdc_layout');
  16. $tdc_sidebar_pos = td_util::get_category_option($cur_cat_id, 'tdc_sidebar_pos');////swich by RADU A, get_tax_meta($cur_cat_id, 'tdc_sidebar_pos');
  17.  
  18. //set the template id, used to get the template specific settings
  19. $template_id = 'category';
  20.  
  21. //prepare the loop variables
  22.  
  23. $loop_module_id = td_util::get_option('tds_' . $template_id . '_page_layout', 1); //module 1 is default
  24. $loop_sidebar_position = td_util::get_option('tds_' . $template_id . '_sidebar_pos'); //sidebar right is default (empty)
  25.  
  26. //override the category global template with the category specific settings
  27. if (!empty($tdc_layout)) {
  28. $loop_module_id = $tdc_layout;
  29. }
  30.  
  31. if (!empty($tdc_sidebar_pos)) {
  32. $loop_sidebar_position = $tdc_sidebar_pos;
  33. }
  34.  
  35.  
  36. switch ($loop_sidebar_position) {
  37. case 'sidebar_left':
  38. echo td_page_generator::wrap_start();
  39. ?>
  40. <div class="span4 column_container">
  41. <?php get_sidebar(); ?>
  42. </div>
  43. <div class="span8 column_container">
  44. <?php
  45. //load the author box located in - parts/page-category-slider.php - can be overwritten by the child theme
  46. locate_template('parts/page-category-slider.php', true);
  47. ?>
  48.  
  49.  
  50. <?php locate_template('loop.php', true);
  51. //the category description
  52. if (!empty($cur_cat_obj->description)) {
  53. echo '<div class="entry-content">';
  54. echo $cur_cat_obj->description;
  55. echo '</div>';
  56. }
  57. echo td_page_generator::get_pagination(); ?>
  58. </div>
  59. <?php
  60. echo td_page_generator::wrap_end();
  61. break;
  62.  
  63. case 'no_sidebar':
  64. echo td_page_generator::wrap_start();
  65. ?>
  66. <div class="span12 column_container">
  67. <?php
  68. //load the author box located in - parts/page-category-slider.php - can be overwritten by the child theme
  69. locate_template('parts/page-category-slider.php', true);
  70. ?>
  71.  
  72.  
  73. <?php locate_template('loop.php', true);
  74. //the category description
  75. if (!empty($cur_cat_obj->description)) {
  76. echo '<div class="entry-content">';
  77. echo $cur_cat_obj->description;
  78. echo '</div>';
  79. }
  80. echo td_page_generator::get_pagination(); ?>
  81. </div>
  82. <?php
  83. echo td_page_generator::wrap_end();
  84. break;
  85.  
  86.  
  87.  
  88. default:
  89. echo td_page_generator::wrap_start();
  90. ?>
  91. <div class="span8 column_container">
  92. <?php
  93. //load the author box located in - parts/page-category-slider.php - can be overwritten by the child theme
  94. locate_template('parts/page-category-slider.php', true);
  95. ?>
  96.  
  97.  
  98. <?php locate_template('loop.php', true);
  99. //the category description
  100. if (!empty($cur_cat_obj->description)) {
  101. echo '<div class="entry-content">';
  102. echo $cur_cat_obj->description;
  103. echo '</div>';
  104. }
  105. echo td_page_generator::get_pagination(); ?>
  106. </div>
  107. <div class="span4 column_container">
  108. <?php get_sidebar(); ?>
  109. </div>
  110. <?php
  111. echo td_page_generator::wrap_end();
  112. break;
  113. }
  114.  
  115.  
  116. get_footer();
  117. ?>
Advertisement
Add Comment
Please, Sign In to add comment