WordPress.org

Ready to get started?Download WordPress

Forums

Thematic
[resolved] List custom taxonomy terms in child theme (4 posts)

  1. wiktoratgmail
    Member
    Posted 2 years ago #

    I have custom post type "products" and custom taxonomy "products_categories".
    I want to display all "products_categories" on custom page "page-offer.php".

    I've put this code under the_content() tag:

    //list terms in a given taxonomy (useful as a widget for twentyten)
    $taxonomy = 'products_categories';
    $tax_terms = get_terms($taxonomy);
    ?>
    <?php
    foreach ($tax_terms as $tax_term) {
    echo '<li>' . '<a href="' . esc_attr(get_term_link($tax_term, $taxonomy)) . '" title="' . sprintf( __( "View all posts in %s" ), $tax_term->name ) . '" ' . '>' . $tax_term->name.'</a></li>';
    }

    And I get nothing! It's problem with global variables?

    http://wordpress.org/extend/themes/thematic/

  2. wiktoratgmail
    Member
    Posted 2 years ago #

    Attention Everyone! Empty categories aren't displayed!

    I've add post to one category and it get displayed.

  3. esmi
    Forum Moderator
    Posted 2 years ago #

    We know. That's the default behaviour for the vast majority of themes and WordPress core itself.

  4. adige72
    Member
    Posted 2 years ago #

    So is there any way to list empty categories as well?

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic

Tags