sim156546

myloop.php

Oct 1st, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.00 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;
  9.  
  10. $current_category_id = get_query_var('cat');
  11. $current_category_obj = get_category($current_category_id);
  12.  
  13.  
  14. //read the per category setting
  15. $tdc_layout = td_util::get_category_option($current_category_id, 'tdc_layout');//swich by RADU A, get_tax_meta($cur_cat_id, 'tdc_layout');
  16. $tdc_sidebar_pos = td_util::get_category_option($current_category_id, 'tdc_sidebar_pos');////swich by RADU A,  get_tax_meta($cur_cat_id, 'tdc_sidebar_pos');
  17.  
  18. // sidebar position used to align the breadcrumb on sidebar left + sidebar first on mobile issue
  19. $td_sidebar_position = '';
  20. if($loop_sidebar_position == 'sidebar_left') {
  21.     $td_sidebar_position = 'td-sidebar-left';
  22. }
  23.  
  24. //set the template id, used to get the template specific settings
  25. $template_id = 'category';
  26.  
  27. //prepare the loop variables
  28.  
  29. $loop_module_id = td_util::get_option('tds_' . $template_id . '_page_layout', 1); //module 1 is default
  30. $loop_sidebar_position = td_util::get_option('tds_' . $template_id . '_sidebar_pos'); //sidebar right is default (empty)
  31.  
  32. //override the category global template with the category specific settings
  33. if (!empty($tdc_layout)) {
  34.     $loop_module_id = $tdc_layout;
  35. }
  36.  
  37. if (!empty($tdc_sidebar_pos)) {
  38.     $loop_sidebar_position = $tdc_sidebar_pos;
  39. }
  40.  
  41. // sidebar position used to align the breadcrumb on sidebar left + sidebar first on mobile issue
  42. $td_sidebar_position = '';
  43. if($loop_sidebar_position == 'sidebar_left') {
  44.     $td_sidebar_position = 'td-sidebar-left';
  45. }
  46.  
  47. // make the category pulldown filter list to be equal
  48. td_js_buffer::add_to_footer (
  49.     'jQuery().ready(function() {' . "\r\n" .
  50.     'var pulldown_size = jQuery(".td-category-pulldown-filter:first").width();' . "\r\n" .
  51.     'if (pulldown_size > 113) { jQuery(".td-category-pulldown-filter .td-pulldown-filter-list").css({"min-width": pulldown_size, "border-top": "1px solid #444"}); }' . "\r\n" .
  52.     '});'
  53. );
  54.  
  55. ?>
  56.  
  57. <?php td_api_category_template::_helper_show_category_template() ?>
  58. <?php td_api_category_top_posts_style::_helper_show_category_top_posts_style() ?>
  59.  
  60.  
  61. <div class="td-main-content-wrap td-container-wrap">
  62.     <div class="td-container">
  63.  
  64.  
  65. <?php                                
  66.  
  67.  
  68.  
  69.  
  70.  
  71. $categories=get_categories(
  72.     array( 'parent' => $cat )
  73. );
  74.  
  75.  
  76.  
  77. $child_categories = get_categories($args);
  78.  
  79.  
  80. foreach ($categories as $c) {
  81.  
  82. $shortcode= <<<EOF
  83. [vc_row]
  84.   [td_block_7 custom_title="{$c->name}" custom_url="https://www.superinformati.com/{$c->slug}" category_id="{$c->cat_ID}"]
  85. [/vc_row]
  86. EOF;
  87.    
  88. echo do_shortcode($shortcode);  
  89. }
  90.  
  91. ?>  
  92.  
  93.         <!-- content -->
  94.         <div class="td-pb-row">
  95.        
  96.        
  97.        
  98.             <?php
  99.                 switch ($loop_sidebar_position) {
  100.  
  101.                     default: //default: sidebar right
  102.                         ?>
  103.                             <div class="td-pb-span8 td-main-content">
  104.                                 <div class="td-ss-main-content">
  105.  
  106.                                    
  107.                     <?php locate_template('myloop.php', true);?>
  108.                                     <?php td_page_generator::get_pagination(); ?>
  109.                                 </div>
  110.                             </div>
  111.  
  112.                             <div class="td-pb-span4 td-main-sidebar">
  113.                                 <div class="td-ss-main-sidebar">
  114.                                     <?php get_sidebar(); ?>
  115.                                 </div>
  116.                             </div>
  117.                         <?php
  118.                         break;
  119.  
  120.  
  121.                     case 'sidebar_left':
  122.                         ?>
  123.                         <div class="td-pb-span8 td-main-content <?php echo $td_sidebar_position; ?>-content">
  124.                             <div class="td-ss-main-content">
  125.                                 <?php locate_template('myloop.php', true);?>
  126.                                 <?php td_page_generator::get_pagination(); ?>
  127.                             </div>
  128.                         </div>
  129.                         <div class="td-pb-span4 td-main-sidebar">
  130.                             <div class="td-ss-main-sidebar">
  131.                                 <?php get_sidebar(); ?>
  132.                             </div>
  133.                         </div>
  134.                         <?php
  135.  
  136.                         break;
  137.  
  138.  
  139.                     case 'no_sidebar':
  140.                         ?>
  141.                         <div class="td-pb-span12 td-main-content">
  142.                             <div class="td-ss-main-content">
  143.                                 <?php locate_template('myloop.php', true);?>
  144.                                 <?php td_page_generator::get_pagination(); ?>
  145.                             </div>
  146.                         </div>
  147.                         <?php
  148.                         break;
  149.                 }
  150.             ?>
  151.         </div> <!-- /.td-pb-row -->
  152.     </div> <!-- /.td-container -->
  153. </div> <!-- /.td-main-content-wrap -->
  154.  
  155. <?php
  156.  
  157. get_footer();
Add Comment
Please, Sign In to add comment