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