If you are using just using 4 posts, I think that schools
would better be suited as taxonomy terms rather than a post type. Associate your Posts with the school tax term. I would then create custom templates for each of those terms.
- taxonomy-schools-cambridge.php
- taxonomy-schools-teeside.php
- taxonomy-schools-newcastle.php
- taxonomy-schools-sunderland.php
Within those templates, use a WP_Query object to surface those posts. Read more about WP_Query taxonomy parameters here.
Your URLs would still be /schools/sunderland/ etc…
This seems like an easier out-of-the-box approach rather than creating new functions to do the same thing. Though, this comes down to UI preference at the end of the day.
Related Posts:
- Placing a Custom Post Type Menu Above the Posts Menu Using menu_position?
- Editor access to menu: custom post type missing
- Custom Post Type – Portfolio no longer works
- How can I put content before my custom post type default pages?
- How we can create menu from Appearance > Menu and use as a add-submenu-page for admin menu?
- Selecting a post in Dashboard
- Custom Post Types don’t highlight in menu nav
- Custom Post List View: Page or something else?
- Querying both pages and posts
- Using default WP menu functionality to link to custom post-type listing?
- Custom admin post.php page
- Custom Taxonomy back-end customizations
- How to add a custom-post-type post within another custom-post-type post edit screen using AJAX?
- Second Set of Eyes: One custom taxonomy shows in Appearance > Menus, one does not
- Visual editor issue by having multiple tiny mce editors in a CPT
- Filter term taxonomy metabox in custom post type
- CPT post count is 0 for the authors in the User list
- Addition of custom option panel crashes Media Library & Admin Area
- page menu entry for custom post type
- Tracking changes in admin-page so user gets warning when leaving the page
- Possibilities for the edit.php admin panel? [closed]
- How to display custom WP menus?
- Filter hierarchical custom post type admin page by parent, and include children & grandchildren
- Admin Filter – Add Post Type Description on Post Type Page
- Custom post type editor with dynamic selects, one drop down populating a second second drop down not working
- WP-ADMIN – Listing all CPT in “posts” listing
- manage_edit-{post_type}_sortable_columns sorts, but wrong!
- Is there a way to establish parent/child relationship in WP menu links exclusively?
- Use custom walker to add taxonomy terms to main nav menu
- P̶l̶a̶c̶e̶h̶o̶l̶d̶e̶r̶ *Default* content in Custom Post Type TinyMCE editor
- A page that shows a list of a specific custom post type
- Custom Postype specific changes in admin panel
- Grouping of CPTs and taxonomies into menu groups in admin
- Is it possible to activate customfield ‘text description’ upon activating the customfield ‘checkbox’?
- Single custom post type’s menu ancestor/parent is Posts archive page
- Target post type edit page to change view post button, how do I?
- menu link to custom post_type?
- Review site custom post type structure
- Custom Post Types in the WordPress Navigation Menu
- It’s possible to hide body copy box for a custom post type?
- Show data from one Custom Post Type in another Custom Post Type
- Show all tags on custom post type
- Add a custom text to admin footer in a Custom Post Type page
- Creat new admin url for custom post type
- Custom Field values not Showing in Edit Page of Custom Post Type
- Custom Post Type & Custom Menu Walker to append custom class for active post types
- Ordering Submenu Pages in WP 3.1
- Including link to custom post type in ‘wp_list_pages’ function
- WordPress custom post type capabilities issue
- Which Template Page Should I Use?
- How can i automatically add CPT single pages as sub menu items
- Set thumbnail and title for a post type archive (not post itself!)
- Editor / Add Media: Is it possible to only allow galleries?
- Custom WP_Query doesn’t display all posts
- How can I use archive-{post_type}.php theme template?
- Custom Post Type Link added to menu won’t show in frontend
- How To Display A List Of CPT Posts In A Meta Box On Menus Page?
- Get custom post type categories to show up in menus
- wysiwyg editor don´t export paragraph
- How can I create an automatic drop down menu with my tags?
- show current item in custom menu, when inside a custom post type
- WordPress menu with custom taxonomy
- Prevent custom post type from showing up in custom menus
- Hide Status Option From WordPress Publish Metabox and Rename Published on:
- Create field of Custom Post Types
- Custom posts of one type have disappeared from admin. Still appear on site [closed]
- How to get the custom post list to admin user edit page?
- Copy order items with metadata between orders – Woocommerce
- Capabilities not working with custom post type
- Change link for “add new” buttons on custom post type
- How do I edit the WordPress post.php file?
- Add data to post edit page, when post is published
- Custom capabilities not reflecting on admin panel
- How to limit what Editors see in the admin?
- Multiple wp_editor instances in custom post type using Ajax
- How to programmatically add elements in a custom menu
- Questions regarding add_meta_box()
- Change Post Meta via AJAX from the posts list table
- Custom Posttype and menu classes
- Custom Attachment Type
- Function to add custom HTML into head in custom post-type list page
- Sorting custom post types in edit.php : Post disappear
- highlight parent page menu item when in custom post type
- How to customize `Edit-Post` Screen
- Sort by post word count in admin area
- Custom post type post in custom menu
- Custom post type posts wont show in wp_nav_menu()
- How to display magic field’s custom write panel in wordpress theme?
- Home page is getting current-menu-item even if it’s not home
- jQuery UI & Admin (Calendar)
- Placing Admin Post Metaboxes in Tabs
- Change ordering of fields of custom post type in admin page
- How to display author details in a custom post type in the wordpress backend?
- Add Content Column to Custom Post Type backend
- Menu for taxonomies and posts belongs to taxonomy
- How to fix the Post Preview Button (CPT & map_meta_cap)
- Change Text in Admin Panel
- How do I disable the built-in editor and automatically configure the properties of new pages?
- Admin slow on Postlist (over 30k Posts in Database)
- Hide title field of selected post-types on edit pages