Best way to add support for Cities?

I would like to know the best way to set up the plugin so i can have various categories in different cities.
I know i can create a taxonomy called "cities" and have an archive for all entries within that, but how do i go about listing an archive for "category1" in "city1" and have a permalink structure like > mysite.com/city/london/plumbers/

ps. Is there any documentation anywhere (not the usage page) where i can find hooks & filters?

Thanks
John.

  • PoshWeb
    • Design Lord, Child of Thor

    Hi Vinod,

    Thanks for the link. To be honest though, the permalink structure was actually my second concern. What i was really asking was how to structure the directory in the most efficient way....
    Should i set up terms within my listing_category for my cities, then have my other categories as chilren of those? This would be a lot of work to initially set up...

    ...or...

    should i set up a new taxonomy for my cities, and have my "plumber/etc/etc" categories within listing_category - then link the two together somehow?

    I'm sure most people that download Directory will want to categorise by "business-type" and also by "city/area"...and also by "business-type in city/area" so i was just wondering how to do that?

    Thanks

  • Vinod Dalvi
    • WP Unicorn

    Hi John,

    ps. Is there any documentation anywhere (not the usage page) where i can find hooks & filters?

    I didn't find any documentation for hooks & filter but you can find it by searching add_action and add_filter in the plugin source code.

    Regarding adding support for Cities, i think creating separate taxonomy for cities will be a good option.

    Kind Regards,
    Vinod Dalvi

  • PoshWeb
    • Design Lord, Child of Thor

    Regarding adding support for Cities, i think creating separate taxonomy for cities will be a good option.

    Ok, but you haven't really answered my question! How do i link everything together?

    I can think of 3 scenarios for a directory website:
    1) Niche directory eg wpmu-plumbers.com
    This is easy out-of-the-box, just use the listing_category for all the cities, since there are only plumbers on the site

    2) City directory eg wpmu-london.com
    This is easy out-of-the-box, just use listing_category for plumbers,electricians etc, since all the entries will be in London.

    3) National directory eg wpmu-yelp.com
    This is what i want to achieve and seems to be something most people would want. I want multiple categories for business types AND multiple categories for cities.

    Visitors need to find information relative to their location else the directory is useless.

    A visitor from London wants to search for plumbers in London!

    I know how to create taxonomies, but how do i tie things together so that i can display city-specific pages of results?

  • Vinod Dalvi
    • WP Unicorn

    Hi John,

    Thank you for your detailed reply.

    I know how to create taxonomies, but how do i tie things together so that i can display city-specific pages of results?

    You can use plugin like this http://wordpress.org/plugins/query-multiple-taxonomies/ ( Please test it in test site before using in production site ) or develop custom code by using taxonomy parameters http://codex.wordpress.org/Class_Reference/WP_Query#Taxonomy_Parameters

    Cheers.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.