Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

Call_Me_Matthew on "How to assign a Page Template to certain URL Patterns?"

$
0
0

Is there a way to set up a page template that assigns itself to pages of a particular url structure?

For example, say you have these urls:

http://www.mysite.com/beachhouse/snippet
http://www.mysite.com/hospital/snippet
http://www.mysite.com/farm/snippet
http://www.mysite.com/mansion/snippet

I don't want to have to create pages manually for every "snippet' subpage on my site. Instead, I want to create a page template that will load automatically when a url with a pattern of "http://mysite.com/x/snippet" is visited.

I've already created a template file that loads content dynamically depending on the parent page(it takes the parent's slug from the url and serves up content based on that). I just need help figuring out how to assign it to a specific url pattern, as opposed to a page.

Thanks for any help!


Viewing all articles
Browse latest Browse all 8245

Trending Articles