Support » Fixing WordPress » Display List of Custom Post, taxonomy & terms

  • I used following code to display custom post & taxonomy, but its not display terms under its parent.
    My Custom Post: Product
    Taxonomy: producttype

    [ Moderator Note: Please post code or markup snippets between backticks or use the code button. ]

                    $terms = get_terms('producttype');
                        foreach ($terms as $term)
                            $wpq = array ('taxonomy'=>'producttype','term'=>$term->slug);
                            $myquery = new WP_Query ($wpq);
                            $article_count = $myquery->post_count;
                            echo "<h3>";
                            	echo '<a href="'.get_term_link($term, $taxonomy).'">'.$term->name.'</a>';
                            echo "</h3>";
                            if ($article_count)
                                echo "
                                while ($myquery->have_posts()) : $myquery->the_post();
                                echo "
                                echo "</ul>
  • The topic ‘Display List of Custom Post, taxonomy & terms’ is closed to new replies.