• Resolved teamcanada613

    (@teamcanada613)


    Hey there, need a little help, I made a custom taxonomy to go with my custom post type, that part works fine, now i am stuck with trying to display the category its in on a page pulling it from the custom post types taxonomy category..

    this is the closest I’ve gotten too,

    <?php
    $args=array(
      'name' => 'project_category'
    );
    $output = 'objects'; // or names
    $taxonomies=get_taxonomies($args,$output);
    if  ($taxonomies) {
      foreach ($taxonomies as $taxonomy ) {
        echo '<p>' . $taxonomy->name . '</p>';
      }
    }
    ?>

    all it prints is project_category and not the actual category of Development or Design

Viewing 2 replies - 1 through 2 (of 2 total)
  • I think you are confusing taxonomies with terms. The taxonomy in your case is project_category and the actual categories are terms.

    What you are trying to do can be done with wp_get_object_terms. It can be used to fetch all the terms for a particular post.

    Thread Starter teamcanada613

    (@teamcanada613)

    Thanks a lot pal, issue was resolved, i appreciate it, are you able to help me locate a page that can inform me on how to disable the main categories throughout the site from my custom post types?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Display Custom Taxonomy Category on Page’ is closed to new replies.