Osclass Support Forums
Osclass theme support => Zara Osclass Responsive Theme => Topic started by: zovi on February 20, 2018, 11:44:09 PM
-
Hi
How do I hide/remove empty subcategories on main page? Just show sub-categories with one or more adds.
Of course, all subcategories should be displayed when creating an new ad.
Can somebody tell me how to do that?
Thanks in advance.
-
@zovi
You can put condition there in file:
oc-content/themes/zara/inc.category.php
Find:
<div class="link-wrap">
<a href="<?php echo osc_search_url($search_params); ?>" <?php echo ($s['pk_i_id'] == $search_cat_id ? 'class="bold"' : ''); ?>>
<?php echo $s['s_name'] . ' <strong>' . $s['i_num_items'] . '</strong>'; ?>
</a>
</div>
Replace with:
<?php if($s['i_num_items'] > 0) { ?>
<div class="link-wrap">
<a href="<?php echo osc_search_url($search_params); ?>" <?php echo ($s['pk_i_id'] == $search_cat_id ? 'class="bold"' : ''); ?>>
<?php echo $s['s_name'] . ' <strong>' . $s['i_num_items'] . '</strong>'; ?>
</a>
</div>
<?php } ?>
<?php } ?>
-
Hello my Hero ;)
Works perfectly! Thanks a lot.
Great support!
You can mark this Topic as Solved. I can't find where I can do it by myself.
Have a nice Day
Zovi