WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have posts of stores and restaurants in my area. Each post is marked by category of type (e.g. Restaurant, store) and town.

What I am trying to do is create a page for each town (with intro text and photos enter into the page ui) and then a loop of Posts in that town's category grouped by the other categories.

Ideally, I'd like to get the current page's slug, or last part of the url to use for the post query: as in "http://mysite.com/towns/mayberry" would display all posts in the mayberry category grouped by the other tags.

So my page is

Mayberry some content

Listings: Restaurants (in mayberry only) - item - item

Hotels (in mayberry only) - item - item

Is this possible?

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.