display posts when clicking term link
-
In the code below, i created link using tax terms. The result i was expecting is when i click on a link, i would like to be redirected to a page showing all the posts for the terms. But it don’t work!!
Could you please help?
Thank you$terms = get_terms( 'smartphones' ); if ( ! empty( $terms ) && ! is_wp_error( $terms ) ){ foreach ( $terms as $term ) { echo '<div class="col col1-4"> <a href="' . get_term_link( $term->slug, 'smartphones' ) . '"> <img src="' . get_stylesheet_directory_uri() . '/images/' . lcfirst($term->name) . '.png"></a></div>'; } }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘display posts when clicking term link’ is closed to new replies.