5

I'm working on a real-estate site where I need to create a profile for each agent, the initial view when you click on view agents would be to list them alphabetically, ideally from a dropdown you could select a region to view all the agents from that region, or chose a language to view all the agents who speak a given language.

My thinking is Agent would be a custom post type, region and language would be a taxonomy.

The listing of agents would then be created by showing many posts, just only showing limited details, then when clicked act as a single post, with more details shown?

Does this seem like the best way to go about this?

Thanks

1 Answer 1

6

That Sounds about right, I'm just about to finish similar project with the same base (post type, taxonomies) structure, so here are a few notes to get you going:

  • To enable your "view agents" make sure when you register agents post type that you set has_archive to true or use string as archive slug which will make your life much easier.
  • When registering custom taxonomies make sure to set rewrite to true.
  • Create a custom template taxonomy-{taxonomy}.php for each of your custom taxonomies (even if they both show the same thing, trust me on this one) this will save you a lot of time.
  • On your "view agents" template file (archive-agents.php) Use wp_dropdown_categories function to generate your region and language dropdowns.
  • And last create your single-agents.php template file to display the full information of the agent.
2
  • Cannot argue with the points you have made there. I remember my first custom post type set-up. Its very confusing at first but after you've done a few its easy peasy :)
    – Scott
    Apr 13, 2011 at 10:14
  • Thanks should be an interesting weekend ahead, if anyone else has any other tips they're greatly appreciated.
    – Chuck
    Apr 13, 2011 at 13:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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