Replies: 0
I am struggling with figuring out how to do this “the right way”.
I am trying to modify an existing WP site with a lot of content. They want a custom page that shows a list of people from a database, and that list needs to be filterable (location, rating, keywords). Then from that list, they need to be able to click on the person and see more details, and that more detailed page will have external API calls to things like Facebook ratings and such.
Fake Example: http://mysite.com/my_fancy_list/
Click on Person: http://mysite.com/my_fancy_list/billy_bob
My first approach was to make a plugin with a shortcode “my_fancy_list”, made a post with the shortcode in it, and have it display content from a new database table. That works well, and it does it within the theme and looks like it belongs with the site.
But then if I want to click on “billy bob” that’s where things get lost, and I don’t want to have to write a shortcode for every single potential page this thing might grow into. The goal was for them to be able to add data in one place in the admin screen.
If I don’t use a shortcode to catch “billy bob” then I just get a standard PHP response outside of the WP theme.
Then I got a recommendation to use a Custom Post Type. This seems appealing because I can use taxonomies as a means to filter on the primary page (I think, this is an assumption). But I’m not sure if I’ll be able to set up the Custom Post Type to do everything I need from start to finish (display the list in a theme, display more details in the theme, make external API calls in that final display).
So what I need is a nudge in the right direction with some guidance steps. As with most things in the dev world, there’s multiple ways to accomplish the same thing but I’d like to pick the best one.