Categories
CMS Development Wordpress

display current portfolio categories from a specific parent

I’d like to ask some help for this code for my wordpress page. I would like to display just the current portfolio categories on a portfolio page. I used this code, but it shows all the portfolio categories from the ‘6’ parent. Thank you!

<?php 
$args = array(

  'hierarchical' => 1,
  'taxonomy' => 'portfolio_category',
  'hide_empty' => 0,
  'parent' => 6,
);
$categories = get_categories($args);

foreach($categories as $category) {

  echo '<a href="' . get_category_link($category->cat_ID) . '" title="' . $category->name . '">' . $category->name . '</a><br>';

  } 

?>

Leave a Reply

Your email address will not be published. Required fields are marked *