Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

The project I'm working on discusses local farming/agriculture/etc. initiatives and I'm ultimately wanting to create a directory with the following features:

  • Separation between:
    1. Urban farms
    2. Farmers' markets
    3. Locally-buying businesses
  • For each location, listing of:
    1. Name
    2. Hours
    3. Address
    4. Description
    5. Website/email/twitter
    6. Category as per the above
    7. User comments
    8. User rating (I.e., n/5 stars)
  • A Google map, with a marker placed for each location (via its "Address" field)
  • Ideally, the ability to associate events and other content with each location

I've tried custom post types via a combination of the plugins Advanced Custom Fields, Custom Post Type View Generator and Custom Post Type UI and cannot get them to work together. Further, I'll have to manually create a bunch of custom page templates via this method just because WP doesn't seem to do this itself — something I'd like to avoid, if only in how frustrating I've found do so in the past with a previous, ill-conceived WP custom post types project.

I'm currently thinking about using Events Manager for the event — and just setting up each location as a Venue — but this is a bit hacky and I'd have to put all the extra detail (hours, website, etc.) as a single text blog in the description.

Is there a way to intelligently do this in WordPress — or a plugin (NOT a theme) that does this — or should I just use Drupal?

Thanks.

share|improve this question
add comment

1 Answer 1

It is possible to set up a location-based directory using WordPress - I did it recently, and I personally find it easier to achieve than - well, almost anything with Drupal but that's likely because I have no experience with Drupal.

The trick is to work out beforehand what is best expressed as a taxonomy and what as a meta field, as querying posts by taxonomy is simple whereas querying by custom fields can get very complex and expensive on database resources due to the EAV structure of the postmeta table.

Not sure what you mean by creating page templates - any custom post types without templates fall back to built-in templates as described in the template hierarchy section of the Codex - I believe the assumption is that if you're looking for your template to be different to the built-in archive, single or index templates you might as well create them from scratch.

tl;dr version: It's possible, but would take some custom code. Can be implemented either as a plugin or in a theme - I assume your objection to a theme would be that you want the functionality to be unaffected if the client were to change theme?

share|improve this answer
    
Hi! Thanks for the response. Was more not wanting a suggestion in the "Use this premium directory theme that does some of what you want" vein. If I had "Event" as a custom post type and "Place" as another, how would I create a relationship between the Event's "Venue" field and a "Place" post? –  aendrew Nov 23 '11 at 13:38
    
That's an interesting one. One way to do it (off the top of my head) would be to use a shared taxonomy between the post types as a sort of lookup table. –  Chris Cox Nov 23 '11 at 13:43
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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