Most used concept of the WordPress is custom taxonomies as well as custom post. We can build our own custom post as well as taxonomies.
If you want to list terms of your custom taxonomies then you can simply use function named get_terms which takes two arguments. First one is array of the taxomonies which you want to list and array of different arguments like order,slug,orderby,search etc. Let's take an simple example.
<?php
//list terms in a given taxonomy
$taxonomy = 'smartcities';
$smart_terms = get_terms($taxonomy);
?>
<ul>
<?php
foreach ($smart_;terms as $smart_term) {
echo '<li>' . '<a href="' . esc_attr(get_term_link($smart_erm, $taxonomy)) . '" title="' . sprintf( __( "View all posts in %s" ), $smart_term->name ) . '" ' . '>' . $smart_term->name.'</a></li>';
}
?>
</ul>
In above example we are fetching terms of custom taxonomies named smartcities and displaying in listing.
0 Comment(s)