Listing Custom Taxonomy Terms loop
-
Hello guys;
I am developing a WP website for a client selling electronic safes. He wants his current static site in to CMS using WP. I am trying to replicate this page from his static website https://www.ktindia.co.in/products/electronicsafes/ into a WP loop.
I have created a custom taxonomy called ‘safe-type’ under which I have made terms ‘fire-resistant-series’, ‘laptop-series’, ‘large-series’, ‘medium-series’, ‘small-series’, ‘standalone-series’ & I want them all to be in a loop and display just like in the link mentioned above.
I tried this code, but it only shows the linked terms not the data inside them.
<?php //list terms in a given taxonomy $taxonomy = 'industry'; $tax_terms = get_terms($taxonomy); ?> <ul> <?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>'; } ?> </ul>
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Listing Custom Taxonomy Terms loop’ is closed to new replies.