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?
- Highlighting wp_nav_menu() Ancestor Class w/o Children in Nav Structure?
- How can I remove the “Add New” button in my custom post type?
- Custom Post Types: How-to get rid of editor (-meta box)
- Creating “static” taxonomies to choose from, inside custom post type?
- Change the edit page for a custom post type?
- How do I filter the excerpt metabox description in admin?
- Is it OK to move admin menu items?
- WordPress Custom Post Type Admin Page really slow
- How can I get my Custom Post Types to appear in nav-menus.php ‘Menu’?
- How to add button to post page WordPress 5.x
- Post slug changed using code doesn’t reflect on editor when post is published
- WP Admin default view mode for Custom Post Type
- automatically placing custom post types singles into submenu of main nav menu
- Renaming Menu Item within Admin Menu Section for a Custom Post Type?
- Remove date and category filters when editing custom post types
- How to Programically add to the new WordPress menus
- How to programatically set the post title of a CPT on wp-admin
- Custom Post Type Name Causing Problem
- WordPress User Roles, Custom Post Types, and Admin views
- Settings page above CPT page in admin section
- Remove current_page_parent from posts page link in WordPress nav menu
- Menu highlight custom post type archive
- adding .current* tags to custom post types and taxonomies
- How to get custom post type menu_name?
- Need functionality with all post list available at edit.php
- Show Custom Post Type values in WordPress grid view
- Add the current menu item CSS class to a custom page type archive in WordPress menu
- wp_nav_menu() mark current item ancestor of custom post type
- How to remove ‘create new post’ entry for a custom post type?
- Menu Multiple Taxonomies
- How to customize admin posts based on the user who is logged in
- Change headers in admin posts list
- Admin notice not displaying
- Add/Remove current_page_parent class
- Custom Post Type + 20k posts = blank/404 within Admin edit.php [duplicate]
- Remove rows in the manage post/page view
- Set menu active state for custom posttype and category, given custom taxonomy term
- Display post meta on edit page in admin
- custom post type not showing in menu
- Correct classes for WordPress menu items
- Customize the Dashboard Menu Editor
- How to make this menu drop down or like accordion
- Custom Post Types don’t highlight in menu nav
- Using default WP menu functionality to link to custom post-type listing?
- Custom admin post.php page
- How to add a custom-post-type post within another custom-post-type post edit screen using AJAX?
- 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
- 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
- P̶l̶a̶c̶e̶h̶o̶l̶d̶e̶r̶ *Default* content in Custom Post Type TinyMCE editor
- Custom Postype specific changes in admin panel
- Single custom post type’s menu ancestor/parent is Posts archive page
- menu link to custom post_type?
- Add a custom text to admin footer in a Custom Post Type page
- Custom Post Type & Custom Menu Walker to append custom class for active post types
- How can i automatically add CPT single pages as sub menu items
- Set thumbnail and title for a post type archive (not post itself!)
- Custom WP_Query doesn’t display all posts
- How can I use archive-{post_type}.php theme template?
- 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
- Change link for “add new” buttons on custom post type
- Custom capabilities not reflecting on admin panel
- How to limit what Editors see in the admin?
- Change Post Meta via AJAX from the posts list table
- Custom Posttype and menu classes
- Custom Attachment Type
- Sort by post word count in admin area
- How to display magic field’s custom write panel in wordpress theme?
- Menu for taxonomies and posts belongs to taxonomy
- 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
- Admin Post Table – Remove Title Edit Link
- cpt not display inside nav menu
- How to create a Child & Siblings menu for a custom post type?
- How do I create a customised table list of a custom post type (in the admin area)?
- How to redirect from wp-admin/edit.php to a frontend page for specific custom post type?
- exclude admin archive edit screen
- Simple Data picker meta box
- In the admin, how can you list thumbnails instead of titles for a custom post type?
- Custom post meta box as a sub form
- Add filter button to custom post type in admin area
- “Trash”, “Draft” and count not showing for custom post type in admin panel
- Custom nav menu current item custom link problem
- List all posts from custom post type by taxonomy
- how to override menu widget?
- Show a custom field instead of username in the backend author area
- Can’t preview custom post – Redirected to home page
- current_page_item and custom post type?
- Menu that shows months and filters posts to show only posts from that month and shows posts as sub items
- sidebar hierarchical menu category & custom post type
- Menu Structure and URL structure, with Pages and Post-Type-Posts