0

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:-

taxonmycity

2) Added cities in Taxonomy city

city

3) Taxonomy terms details

terms

  • Did you try with taxonomy-city.php? – Nilambar Jul 15 '14 at 10:18
  • i have tried it its not working for me – Sanjay Nakate Jul 15 '14 at 10:19
  • Are you sure city is the taxonomy name for your custom taxonomy? Can you please confirm? – Nilambar Jul 15 '14 at 10:25
  • yes i have attached snipe in question you can check aloso – Sanjay Nakate Jul 15 '14 at 10:26
  • Have you tried a template file city.php ? Basing this of 'category' being a taxonomy and there's category.php. – rkeet Jul 15 '14 at 10:29
0

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/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.