• Is there a method to create fake pages for categories?

    Let’s say I currently have the following top level categories:

    – Film
    – Gaming
    – Music

    What I want is to be able to have the following as active pages on the site:

    xxx.com/film/news
    xxx.com/film/features
    xxx.com/music/news
    xxx.com/music/features
    etc

    Essentially creating custom archive pages for specific type of content within each category. I just don’t know how to go about creating these “phantom” sub categories in order to be able to have the custom templates for those URLs.

Viewing 3 replies - 1 through 3 (of 3 total)
  • What you are probably looking for is to use custom post types.

    There are plugins such as types and Custom Post Type UI for more advanced users.

    Hope this helps 🙂

    Thread Starter obsessedwithfilm

    (@obsessedwithfilm)

    Nope definitely categories!

    I am aware of the custom post types solution as we utilise it elsewhere.

    I’d rather continue to use categories as they were intended in terms of grouping posts. The sub urls will simply hold specific types of ‘film’ content (eg those tagged with news, features, video etc).

    From a URL perspective it wouldn’t be preferable to have to use ?=news to get the desired effect.

    I was hoping there’d be a way to add a custom sub category without actually creating it as such (especially since they couldn’t have the same slug).

    Moderator bcworkz

    (@bcworkz)

    You could simply add news and features, etc. as regular categories, not sub categories, so posts typically will have two categories assigned. You’ll need a rewrite rule so the parser knows how to deal with the second category. The archive template would also be modified to get this second category so that the query can altered to return only posts containing both categories.

    You could do something similar with tags or a custom taxonomy (or yes, custom post types). It’s mainly a matter of setting up a rewrite that can deal with the added parameter. What that parameter relates to is only a matter of what makes the most sense for a situation.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘"Fake" pages for categorties?’ is closed to new replies.