tags:

views:

17

answers:

1

I'm developing a WordPress theme and I need to have a custom URL for some kind of content.

For example, I need to have a page to show some article details. Now, i've created a page template called "Article", and so i've to create a new page and give it the page template "Article" (I get the url http://mydomain.com/article?id=123) It works fine, but now i'm having dozens of this pages, and it's a mess to create them all on every installation of this theme, so i want to do it in my theme code.

I saw something near that on BuddyPress, where you can use /member/ and it redirects to a member page. I just wanna know how to do so.

Thanks!

A: 

Hi Mateus

If you are running wordpress 3.0 I would recommend making a custom post type for your articles. That would allow you to control the URL in the way that you want and also allow you to use more sophisticated full text urls if you wanted to.

Here are some links to some tutorials about how to make a custom post type to get you started:

http://kovshenin.com/archives/custom-post-types-in-wordpress-3-0

http://kovshenin.com/archives/extending-custom-post-types-in-wordpress-3-0/

The second one has an example file that you can download and edit to help you get started.

Cheers, Paul

Paul Sheldrake