Osclass Support Forums

Osclass theme support => Starter Osclass Premium Theme => Topic started by: ishan on February 09, 2020, 03:39:53 PM

Title: how to display categories subcategories name two times on home page
Post by: ishan on February 09, 2020, 03:39:53 PM
how to display categories subcategories name two times on home page.

We want to display categories on mobile sidebar and on desktop home page

we are using below code but its showing categories once only on home page not 2 times. we put code 2 times but showing 1 time only. please help

 <?php while(osc_has_categories()) { ?>
      <?php $search_params1['sCategory'] = osc_category_id(); ?>
      <?php
        if($root_cat_id1 <> '' and $root_cat_id1 <> 0) {
          if($root_cat_id1 <> osc_category_id()) {
            $cat_class1 = '';
          } else {
            $cat_class1 = ' active';
          }
        } else {
          $cat_class1 = '';
        }

        $color1 = starter_get_cat_color(osc_category_id());
      ?>
      <a
        id="cat-link"
        rel="<?php echo osc_category_id(); ?>"
        <?php if(osc_is_home_page()) { ?>href="#ct<?php echo osc_category_id(); ?>"<?php } else { ?>href="<?php echo osc_search_url($search_params1); ?>"<?php } ?>
        class="<?php if(osc_is_home_page()) { ?>open-home-cat<?php } ?><?php echo $cat_class1; ?>"
      > <span class="icon "><?php echo starter_get_cat_icon( osc_category_id()); ?></span>
        <span> <?php echo osc_category_name(); ?></span>
      </a>
    <?php } ?>
Title: Re: how to display categories subcategories name two times on home page
Post by: MB Themes on February 09, 2020, 04:37:05 PM
Before showing second time, you mmust add before 2nd block function osc_goto_first_category() ... or it has similar name