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

Currently I've divided posts into 5 different categories, based on the categories I've created 5 page templates. all of the pages are listed into the home page navigation menu. in my home page I'm showing 5 posts in five different categories. when they clicked a post that post will shown in the single page template(that's what word press normally does) but i want to show that post into my page template. because each page template having different designs. if there is any way to set the permalink to point to the page template and show the post in to full.

share|improve this question
up vote 0 down vote accepted

The »Template Hierarchy« doesn't allow this per default.

Inside your single.php template, you can call load_template().

This will allow you to simply include the template you need, based on the in_category() conditional tag.

// inside single.php
if ( in_category( 'foo' ) )
    load_template( get_stylesheet_directory().'foo_template.php' );
elseif ( in_category( 'bar' ) )
    load_template( get_stylesheet_directory().'bar_template.php' );
elseif ( in_category( 'whatever' ) )
    // ...
share|improve this answer
its working fine. You saved me lot of time. thanks – Aroor Jul 30 '12 at 10:48
@Aroor You're welcome! :) – kaiser Jul 30 '12 at 11:52

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.