I am working on a plugin that displays external data, within WordPress.
I am attempting to create two pages. A listing/archive page, and a detail page.
- /cars/ List all cars
- /cars/abc/ List the detail for car abc
What I have tried:
I created rewrites that set
pagename=mypage. This works pretty well, but when I hook
the_content it unfortunately inserts the content inside
<article><div class="entry-content">. What I would like though, is for each car in my list, to be its own entry, such as is done on an archive list, with multiple occurrences of
<article> that I can control the content of.
I also attempted instead to rewrite as
category_name=cars in an attempt to trigger
is_archive(), but when I view the page, because there are no posts in this category (for which there wont be), I get a 404 error and/or Nothing Found.
How can I override this to supply my own data (non-posts). I would like to do this using
the_content or something similar, that doesn't require a custom template. Hopefully getting WordPress to loop through the data, but I would be happy if I can just write out the
<article> entries myself.