How to display custom taxonomy

I have created city taxonomy in back end and i have added mumbai,pune,nashik city in city taxonomy like bellow snipe.

My problem is that when i click the city for example mumbai i want display the all product in the mumbai city which i have set from the product tab means that product is in mumbai city category.

I have tried with bellow code but not getting any thing.

Custom Taxonomies display

Template file used to render the Archive Index page for a Custom Taxonomy

taxonomy-{taxonomy}-{term}.php

As regrading above code i have changed my file name to taxonomy-city-city.php but its not working.tell me if have any body idea about this issue.

Site Link:- Click Here and Click on select your city button

1) Taxonomy city:-

2) Added cities in Taxonomy city

3) Taxonomy terms details

Topic template-hierarchy taxonomy custom-taxonomy templates Wordpress

Category Web


Once you have created custom taxonomies in WordPress, the next step is to display them on post pages. Fortunately, this is a matter of adding the following single line of code to the single.php (located in the theme folder):

<?php the_terms( $post->ID, ‘topics’, ‘Topics: ‘, ‘, ‘, ‘ ‘ ); ?>

By default custom taxonomies use the archive.php template to display posts. However, you can create a custom archive display for custom taxonomies by creating taxonomy-{taxonomy-slug}.php,where taxonomy-slug refers to slug of custom taxonomy.

I have found it here https://www.wpblog.com/create-custom-taxonomies-in-wordpress/

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.