display current portfolio categories from a specific parent

Question

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>';

  } 

?>

--------------------------------------------------

>>> Share a link to this question, just copy and paste the code bellow on your web page <<<

<a href="https://www.wptricks.com/question/display-current-portfolio-categories-from-a-specific-parent/">

display current portfolio categories from a specific parent</a>
0
Peter 7 months 0 Answers 46 views 0

Leave an answer