[wp-hackers] WPMU Global Page / Custom Template

Owen Winkler ringmaster at midnightcircus.com
Thu Sep 21 12:42:39 GMT 2006


Shayne Sweeney wrote:
> Hackers, code cracker's, slackers...
> 
> Looking for another one of your great collaborative solutions that is a
> product of the ingenious minds reading this email. :)
> 
> I am using Wordpress MU.
> 
> Lets say, I want to generate a "mobile" version of ALL the content on my
> WPMU network of blogs dynamically.
> 
> My requirements.
> 
> 1) Our current URL structure...
> 
> http://domain.com/joes-blog/2006/09/21/article-title-here/
> 
> ...here's what I am thinking of ...
> 
> http://domain.com/joes-blog/mobile/2006/09/21/article-title-here/

If you did it the other way around:

http://domain.com/joes-blog/2006/09/21/article-title-here/mobile

There is a function in WP 2.1 (not sure about MU) that allows you to add 
new endpoints to URLs that are parsed by the rewrite class.  A couple of 
hooks later, and you could display an alternate template based on the 
presence of the new endpoint ("mobile") in $query_vars.

Look for the function, called add_endpoint().

Owen



More information about the wp-hackers mailing list