single post, multiple categories (5 posts)

  1. stinker
    Posted 9 years ago #

    I am creating a movie website. I have 6 categories (Genre, Director, etc.), each with its own group of subcategories (for example Genre > Action, Drama, Western, etc.).

    All of my posts are in multiple categories and subcategories.

    I successfully created templates for the various categories and subcategories, using both built-in inheritance and the inheritance plugin (I had to tweak the categories a little, and create sub-subcategories).

    This is where trouble starts.

    When I delete my single.php template, single posts inherit the index.php template. I am happy to leave the single.php file in the template folder, but then how do I get posts to inherit a category template?

    It would be nice if WP could present a page based on referring page. For example, if a user clicks on a link at Google, they get the "single.php" template. But if a user comes from my "Genre > Westerns" page, the post uses the Westerns subcategory template.

    I know this is confusing and a lot to ask, but I greatly appreciate all the help I've gotten up to this point and I thank you for any further help.

  2. moshu
    Posted 9 years ago #

    First of all... since there are hundreds of plugins out there - a link to the plugins you mentioned would be beneficial, otherwise I have no idea what plugins are you using or talking about.

  3. stinker
    Posted 9 years ago #

    I'm using Kafkaesqui's "Category Template Inheritor".


    I was also using Kaf's "Post Templates by Category", but it seems like the functionality I need from that plugin is built into WP 2.0., therefore I turned it off.


    Let me know if you have any questions.

  4. moshu
    Posted 9 years ago #

    You are the first one mentioning that category template-inheritance is built-in into 2.x. I guess, I'll have to check that out...

    On the other hand I can't remember any solution for assigning a template based on referrer.

    Isn't your problem related to the fact that posts belong to multiple categories and WP (or the plugin) is "confused" as to what to inherit?

  5. stinker
    Posted 9 years ago #

    That's right.

    To preface, I'm not a coder. But what if some category information were placed in the referring link. For example...


    This would require a plugin to add the "cat=" to the link and another plugin to receive the information and return the correct template.

    Thanks for taking a look.

Topic Closed

This topic has been closed to new replies.

About this Topic