I know there are countless questions on here about this, but all of them suggest the same thing I'm already trying to do, but I appear to be missing/misunderstanding something here.
I'm creating an FAQs section for a site, and have the following:
faq
custom post typefaqs
custom taxonomy for categorisation of FAQ pages
Both are updated to their most recent versions as of time of writing.
My goal is to have a page that lists all of those FAQ categories, which I can then click, to reveal all of the FAQ pages associated with the FAQ category.
I have created the file archive-faq.php
to try and list the FAQ pages themselves, but the file is not being used.
I have also created the file taxonomy-faqs.php
, to list the different categories in the taxonomy, but the file is not being used.
I'm using the Custom Post Type UI plugin to manage the creation of custom post types and taxonomies, since I have a few of them now.
And I have indeed tried refreshing permalinks, several times.
Just in case this is relevant, I'm using the Advanced Custom Fields PRO plugin to manage the creation of various fields (since this site is comprised entirely of bespoke pages, no blog).
And also, in case this is relevant, I do have a piece of code allowing me to remove the name of the custom post type from the URL to the page:
function remove_slug($post_link, $post) {
if(!in_array($post->post_type, ['availability_page']) || 'publish' != $post->post_status) {
return $post_link;
}
$post_link = str_replace('/' . $post->post_type . '/', '/', $post_link);
return $post_link;
}
add_filter('post_type_link', 'remove_slug', 10, 3);
function parse_request($query) {
if(!$query->is_main_query() || 2 != count($query->query) || !isset($query->query['page'])) {
return;
}
if(!empty( $query->query['name'])) {
$query->set('post_type', array('post', 'availability_page', 'page'));
}
}
add_action('pre_get_posts', 'parse_request');
I'm not hugely adept with WordPress, but the client was insistent we use WordPress for their site. And since I'm so used to ProcessWire (which I believe is a far more practical solution for entirely bespoke websites), I'm finding it a bit difficult to adjust to the very fixed nature of WordPress.
So, any pointers as to why the template files I created are not being used would be greatly appreciated.