exclude child-child of categories (child second level)
-
hello, i have a problem with subcategories navigation. i would like to make a list of only child categories of first level, excluding child categories of second level.
this is my php code:
———————-
<?php
$category = sf_get_category_id(get_option(‘sf_portfolio_category’));
$categories = get_categories(‘child_of=’.$category);
$ppp = (get_option(‘sf_portfolio_pagination’)) ? get_option(‘sf_portfolio_pagination’) : 6;
if (get_option(‘sf_portfolio_nav’)) {
if (!empty($categories)) {
if (isset($_GET[pcat])) {
$pcat = $_GET[pcat];
}
else { $addtoclass = ” class=\”active\””; }
?>…
- <span>select an item:</span>
<li<?=$addtoclass; ?>>“>all
<?php sf_list_portfolio_child_categories($category,$pcat,get_permalink()); ?>———————-
this string “<?php sf_list_portfolio_child_categories($category,$pcat,get_permalink()); ?>” show both child categories and child-child categories. is it possible to exclude the child-child categories in some way?
thank you for helping me
- The topic ‘exclude child-child of categories (child second level)’ is closed to new replies.