I wish to implement a company directory in WordPress and i'm searching for feedback around the ultimate way:
- I've got a groups along with a companies table
- Will I produce a page for each business along with it's category relationship
- Will I produce a page and assign it a template?
- Do you know the good and the bad with every approach?
Searching for some solutions from people who might of already carried this out and may speak from experience
The excellent factor about WordPress is you can go a couple of different routes w/ trying to do this.
One route that's labored well for me personally would be to list each business like a publish after which create groups and sub-groups to accommodate these companies. Once this is accomplished, you may create custom templates for either category templates (therefore if your possess a category named 'Food Establishments' and contains the course id of 5, you may create a template named category-5.php after which WordPress knows to turn to that template first after which move onto the standard category.php file and so forth).
Inside your category template after that you can list out each sub category w/ a function like
wp_list_categories(); and on-site visit the kids groups after that.
Another choice is to still go the path of entering inside your companies like a separate publish, filing them underneath the appropriate groups. But rather than developing a category template, you may create a webpage template. You will need to perform a couple of things with this
Pre-prend your template file w/ the required template syntax to inform WordPress to search for that like a template file for example:
< ?php /* Template Title: Food Institutions */ ?>
Produce a page in WordPress by using this new template
Inside your page template produce a new query, pointing for this category, for example:
< ?php $business_food = new Wordpress_Query('cat=5') ?>
< ?php if ($business_food->have_posts()) : while ($business_food->have_posts()) : $business_food->the_publish() ?>
< ?php the_content() // and do other things here ?>
< ?php endwhile endif ?>
You will find other available choices that you can do too, as well as for individuals, I'd spend time some WordPress user groups to try to grab another ideas.
I have been searching for an identical factor and located this yesterday... http://www.directorypress.net/ It isn't cheap however it appears like it could work.
Checkout www.juicyexeter.co.uk this apparently uses wordpress, maybe try taking some cues out of this.
I believe juicyexeter utilizes a WooTheme: http://www.woothemes.com/2010/03/cityguide/