Return to Snippet

Revision: 63502
at May 13, 2013 15:02 by jefrancomix


Initial Code
<?php 
switch ($wp->request) {
    case 'directory':
      get_template_part('content', 'directory');
      break;
    case 'history':
      get_template_part('content', 'history');
      break;
    default: get_template_part('content', 'default');
};
?>

Initial URL
http://kovshenin.com/2012/current-url-in-wordpress/

Initial Description
Easy way to access request URI to WP in order to not repeat whole templates for minor changes

Initial Title
Access Request URI in WordPress for template reuse

Initial Tags
wordpress

Initial Language
PHP