Custom Post Type with WP Store Locator plugin
-
Hi there,
I’m currently using the plugin WP Store Locator and am having problems getting the “All Stores” page to use a template. I’ve got the Custom Post Type of “theatre” setup and it’s displaying the posts I need.
I’ve gone down the usual route of registering the Custom Post Type using the following settings:
// Theatre Post Type register_post_type('theatre', array( 'show_in_rest' => true, 'supports' => array('title', 'excerpt'), //'rewrite' => array('slug' => 'theatres'), 'has_archive' => true, 'public' => true, 'labels' => array( 'name' => 'Theatres', 'add_new_item' => "Add New Theatre", 'edit_item' => "Edit Theatre", 'all_items' => "View All Theatres", 'singular_name' => 'Theatre' ), 'menu_icon' => 'dashicons-location-alt' ));I’ve created the pages “archive-theatre.php”, “page-theatre.php” and “single-theatre.php” (at the moment “page-theatre.php” is probably redundant but I’m trying everything at the moment to get the template to pull through). “single-theatre.php” is working fine and pulling through the individual “theatre” post type details and is linked to from the parent “theatre” page. However, the “theatre” page itself is defaulting to using the “index.php” as a template which is not what I want.
I’ve saved the “Permalinks” within the “Settings” to see if that’s the problem but that doesn’t seem to affect anything.
Any ideas what the problem may be and how I can diagnose the bug?
I have setup a “films” Custom Post Type which works fine (it uses “archive-film.php” and “single-film.php” as its page templates) but doesn’t use the WP Store Locator plugin which I suspect may be causing a conflict but I can’t be certain.
Here is the Permalink setting I currently have set within the WP Store Locator settings:
https://pasteboard.co/Kf0hLTO.pngAlso, I’ve created a post on the WP Store Locator plugin forum but it seems this issue requires a custom rewrite rule which neither myself or the plugin developer know how to do. Here is the post I created on their forums:
https://ww.wp.xz.cn/support/topic/acf-custom-post-type-with-store-locator/If any other details would be helpful please let me know.
Many thanks!
The topic ‘Custom Post Type with WP Store Locator plugin’ is closed to new replies.