[wp-hackers] Custom Permalinks - how to?

Brian Layman Brian at TheCodeCave.com
Tue Jun 13 19:07:22 GMT 2006


Ha! This is the same subject my last email!
Use template_redirect

See here: http://codex.wordpress.org/Plugin_API

template_redirect

No parameter. Executes before the determination of the template file to be
used to display the requested page. Useful for providing additional
templates based on request criteria. Example (pedagogical, not useful):
Redirect all requests to the all.php template file in the current themes'
directory. 

function all_on_one () {
	include(TEMPLATEPATH . '/all.php');
	exit;
}

add_action('template_redirect', 'all_on_one');



What you are doing is almost exactly what this is designed for.  Take a look
in template-loader.php for more examples...

_______________________________________________
Brian Layman
www.TheCodeCave.com



More information about the wp-hackers mailing list