• Resolved langsuyar

    (@langsuyar)


    I’m trying to use different page templates when my visitors click on the post topic and the isolated post is displayed. Let’s say I have two posts – one is a blog post and one is a business post. I want to use a different page template depending on the post (let’s say both have different sidebars, one specific to blog posts, one for business stuff).

    As far as I can tell, the functionality goes through the_permalink(), and WP defaults to index.php as the page template for the isolated post. I guess I would look making a new version of the_permalink and pass in a parameter that helps the function decide which page to use. Any pointers, tips or examples as to how to modify this?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter langsuyar

    (@langsuyar)

    Gonna bounce this once – does anybody have an idea? ??

    Your theme’s single.php is used for posts. If your posts are either in the blog or business category, you can use the conditional in_category tag to display different sidebars depending on the category of the post. Another option is to look for a plugin that lets you do this.

    Thread Starter langsuyar

    (@langsuyar)

    Thanks, that’s getting me somewhere. Too bad that in_category doesn’t support parent/child relationships or even “in_category(x,y)” (yet?).

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Use custom page template when clicking on post subjects’ is closed to new replies.