{"repo":"makeitworkpress/wp-router","free":true,"listed":false,"github":"https://github.com/makeitworkpress/wp-router","clone":"git clone https://github.com/makeitworkpress/wp-router.git","description":"Enables developers to easily create custom routes with matching templates accordingly.","language":"PHP","stars":32,"topics":["wordpress","wordpress-library","wordpress-development","wordpress-php-library","wordpress-routes"],"license":"GPL-3.0","category":"self-hosted-apps","readme_excerpt":"wp-router Enables developers to add custom routes and templates to their WordPress theme. In other Words, you can easily add custom permalinks to your theme such as yourwebsite.dev/custom/ which in order point to a custom template. WP Router is maintained by Make it WorkPress. Usage Include the WP-Router in your plugin, theme or child theme files. Require it in your functions.php file or use a PHP autoloader. You can read more about autoloading in the readme of wp-autoload. Syntax new MakeitWorkPress\\WP Router\\Router(Array $routes, String $folder, String $query var, Boolean $debug); Create a new instance of WP Router\\Router Create a new instance of the Router class with the array of routes as an argument in the format displayed below. $router = new MakeitWorkPress\\WP Router\\Router( [ 'custom' = ['route' = custom/, 'title' = ('Custom Template Title')], 'another' = ['route' = friedpizza/, 'title' = ('Fried Pizza!')] ], 'templates', // The folder in your theme or child theme where the custom templates are stored. Use any full path to locate templates in plugins. 'template', // The query var by which the template is identified, in this case through get query var('template'). Defaults to template. false // Whether to debug or not, which will output all rewrite rules on the front-end ); The keys of the routes array self indicate the names of the specific template and will also refer to the name of the specific file in your templates folder. Thus, the key custom in the above example","default_branch":null,"files":null,"tree":[],"storefront":"/r/makeitworkpress","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/makeitworkpress/wp-router/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}