WordPress Templating Router: Connect custom permalinks to custom templates

The default WordPress Templating Router handles it permalink structure following its own logic. WP Router allows you to link custom templates, at any location, to any custom permalink. For example, you can link the url /custom/ to the template located at templates/custom.php
 
Thus, WP Router acts as a WordPress templating router. This is particularly useful if you want to include templates that do not follow the logic of WordPress, with it’s post types and archives.

Using WP Router

WP Router can be manually required in your projects, or included using composer. Obviously, WP Router is a script for WordPress.

By creating a new WP Router instance and passing an array with corresponding routes to it, new routes may be registered. The exact procedure is described in the Github repository.

Documentation on the installation and usage of WP Router can be found on Github.

  • Connects custom templates to custom urls
  • Can be used by themes and plugins
  • Useful if you are looking further than posts and pages

Our Free WordPress Script Collection

During the years, we found out that we were repeating the same code over and over in our WordPress development projects. The obvious thought came in mind: Why don’t we store these pieces of code in reusable scripts on GitHub?

But we could just distribute them as free WordPress scripts! And so it happened, our repository was born. These are all free premium WordPress scripts. Have fun developing!

WP Router: a WordPress Templating Router 1

WP Components is a collection of common WordPress components used in websites, such as breadcrumbs or buttons.

WP Custom Fields is a kick-ass framework for custom customizer, options pages and post, taxonomy or user metabox fields.

WP Enqueue is a script for enqueuing WordPress scripts and styles easily.

WP Optimize allows to implement basic optimizations to a WordPress installation by the removal of redundant code.

WP Register is a script that allows to easily register custom posts, taxonomies, sidebars, menus and widgets.

WP Updater is a script to update a theme or plugin through an external repository.

WP Router is a WordPress script that enables a developer to add custom routes and link these to custom templates.

WP Config is a class which can be used to store, add or modify configurations for a theme or plugin.

WP Autoload shows how one can use autoloading with WordPress.