I've created a pretty basic plugin which adds a custom post type with a couple taxonomies and a few custom fields. I would rather use a plugin than simply add it to the theme because I think I might be useful in the future. The problem is that I want to customize the archive page for the particular post type. I could obviously just create a new file, in this case archive-research.php but having it in the theme directory would defeat the purpose of using a plugin. Is there a method whereby I could have the custom archive file as part of the plugin itself?
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
Use
archive_template
filter, from WordPress codex: https://codex.wordpress.org/Plugin_API/Filter_Reference/archive_template