I have two custom post types (Authors and Partners). I display their archive page's in the main navigation and use archive-authors.php and archive-partners.php to make a couple small tweaks to the display of posts in each.
Now, my client would like to display some text before the archive's post listing. So far I can think of the following ways to do that:
- Save the text as the post type's description and display that.
- Create a separate page and hard code a custom
WP_Query()loop for just that page (by ID) above the archive.
- Write a custom loop with
WP_Query()to produce the CPT archive for each CPT and setup "Author Archive" and "Partner Archive" templates that can be used on static, editable pages.
However, all of these solutions seem suboptimal for one or more of the following reasons:
- They require technical knowledge to update (#1, #2)
- It's not abstracted (e.g. the solution has to be custom-coded for each archive) (#2, #3)
- Updating the text requires technical knowledge (#1)
- The solution essentially duplicates the template hierarchy (#3).
I'm looking for a solution that's WordPress friendly, abstracted, and easy-to-update for the client.