• Resolved stunnaboi

    (@stunnaboi)


    I’d like to return the list of taxonomy terms associated with a custom taxonomy. The function wp_list_categories does not seem to work even if I specifiy the database ID for the custom taxonomy term parent.

Viewing 5 replies - 16 through 20 (of 20 total)
  • First off thank you for posting this code. But I’m afaid I’m having a few issues.

    The code works perfectly, execpt for the fact that no information is being displayed in the column until I have clicked ‘Quick Edit’ for each post and then updated the information. This appears to magically bring data into the new columns but disappears again when the page is refreshed.

    Anyone got any idea where I could’ve gone wrong? Almost like the code needs to run on_load as apposed to when the post is updated – if that makes sense?

    Thanks!

    how can i display custom taxonomies on selected pages?
    i mean i have custom taxonomies location,duration & courses
    i have created three pages where i want to display the terms of these custom taxonomies,
    i have displayed it on my posts by using function
    <?php echo do_shortcode("[terms]"); ?>

    but same thing i want to make display on my pages also,
    how can i do that??????

    @niraj – Try this:

    <?php echo get_the_term_list( $post->ID, 'location', '<p>Location  : ', ', ', '</p>' ) ?>
    <?php echo get_the_term_list( $post->ID, 'duration', '<p>Duration  : ', ', ', '</p>' ) ?>
    <?php echo get_the_term_list( $post->ID, 'courses', '<p>List of courses  : ', ', ', '</p>' ) ?>

    You might probably use it in your single-custom-post-type.php just around <?php the_content(); ?>

    I’m having a similar problem as Bennst above; since this thread is marked “resolved” and only partially pertains to my problem, I’ve started a more specific one here: https://www.ads-software.com/support/topic/list-custom-taxonomies-in-custom-columns

    Been looking for the same and just found this. Seemed to be the perfect solution for me and uses wp_list_categories .

    //list terms in a given taxonomy using wp_list_categories (also useful as a widget if using a PHP Code plugin)
    
    $taxonomy     = 'eventcategory';
    $orderby      = 'name';
    $show_count   = 0;      // 1 for yes, 0 for no
    $pad_counts   = 0;      // 1 for yes, 0 for no
    $hierarchical = 1;      // 1 for yes, 0 for no
    $title        = '';
    $empty        = 0;
    
    $args = array(
      'taxonomy'     => $taxonomy,
      'orderby'      => $orderby,
      'show_count'   => $show_count,
      'pad_counts'   => $pad_counts,
      'hierarchical' => $hierarchical,
      'title_li'     => $title,
      'hide_empty'   => $empty
    );
    
    <ul>
    <?php wp_list_categories( $args ); ?>
    </ul>
Viewing 5 replies - 16 through 20 (of 20 total)
  • The topic ‘How to get list custom taxonomy terms for specific taxonomy’ is closed to new replies.