[wp-hackers] Another cooky question about permalinks

scribu scribu at gmail.com
Sun Dec 28 23:25:49 GMT 2008


On Sun, Dec 28, 2008 at 11:39 PM, Mike Schinkel <mikeschinkel at gmail.com>wrote:

> Scribu:
>
> Here is some code that I wrote to reconfigure permalinks for a specific
> client's site, maybe you can find something of use in here?  You might want
> to conditionally run some of the following code depending on what is the
> current URL?
>
>
>
> $wp_rewrite->set_permalink_structure(str_replace('/blog/','/',$wp_rewrite->permalink_structure));
>    $wp_rewrite->front = '/';
>
>    $wp_rewrite->author_base = 'authors';
>    $wp_rewrite->author_structure = '/authors/%author%';
>
>    $wp_rewrite->tag_base = 'tags';
>    $wp_rewrite->tag_structure = '/tags/%tag%';
>
>    $wp_rewrite->category_base = 'categories';
>    $wp_rewrite->category_structure = '/categories/%category%';


The problem with that is that it removes the /blog/ part completely
(right?), and I need the posts to keep it.

I obviously can't use is_single()  and there isn't any
$wp_rewrite->post_structure either.

-- 
http://scribu.net


More information about the wp-hackers mailing list