Guest User

Untitled

a guest
Sep 5th, 2014
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.36 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.  
  52. <?php echo td_page_generator::get_pagination(); ?>
  53. </div>
  54. <?php
  55. echo td_page_generator::wrap_end();
  56. break;
  57.  
  58. case 'no_sidebar':
  59. echo td_page_generator::wrap_start();
  60. ?>
  61. <div class="span12 column_container">
  62. <?php
  63. //load the author box located in - parts/page-category-slider.php - can be overwritten by the child theme
  64. locate_template('parts/page-category-slider.php', true);
  65. ?>
  66.  
  67.  
  68. <?php locate_template('loop.php', true);?>
  69.  
  70. <?php echo td_page_generator::get_pagination(); ?>
  71. </div>
  72. <?php
  73. echo td_page_generator::wrap_end();
  74. break;
  75.  
  76.  
  77.  
  78. default:
  79. echo td_page_generator::wrap_start();
  80. ?>
  81. <div class="span12 column_container">
  82.  
  83. <?php
  84. //load the author box located in - parts/page-category-slider.php - can be overwritten by the child theme
  85. locate_template('parts/page-category-slider.php', true);
  86. ?>
  87.  
  88. </div>
  89. <?php
  90. echo td_page_generator::wrap_end();
  91.  
  92. echo td_page_generator::wrap_start();
  93. ?>
  94.  
  95.  
  96. <div class="span8 column_container">
  97.  
  98. <?php locate_template('loop.php', true);?>
  99.  
  100. <?php echo td_page_generator::get_pagination(); ?>
  101. </div>
  102. <div class="span4 column_container custom-sidebar-background">
  103. <?php get_sidebar(); ?>
  104. </div>
  105. <?php
  106. echo td_page_generator::wrap_end();
  107. break;
  108. }
  109.  
  110.  
  111. get_footer();
  112.  
  113.  
  114.  
  115. ?>
Advertisement
Add Comment
Please, Sign In to add comment