Make your single.php the following:
<?php
$post = $wp_query->post;
if ( in_category( 'work' ) ) {
include( TEMPLATEPATH.'/single-work-cat.php' );
}
else {
include( TEMPLATEPATH.'/single-generic.php' );
}
?>
and make single-work-cat.php the template you wish to show for single work category posts, and single-generic.php the one you wish to show in all other cases. For more categories just add more elseif statements and make new single templates.
Related Posts:
- Single.php Active Category Class
- Using wp_list_categories like the the_category (showing just current categories of a post)
- If in_category not working for multiple single.php pages
- Single.php – Get Current Parent Category
- Can I style single post that are in multiple catergories?
- WordPress – When visiting a `single post/ single.php` my category menu item link becomes active
- Show single post child category from a determined parent
- List posts of assigned categories in list of all categories on single.php
- Including categories in search results
- Different post sort order within different categories
- Display all posts from specific categories on a page
- Convert custom fields to post categories
- Count posts in category including child categories
- Query posts from current year
- Show One Category on Post
- custom single.php not working
- Do I use custom post type or something else?
- What Defines What Category A Post Picks (if in multiple)
- Limit function to specific post category
- Show all post titles
- Add Category name to Post Title (h1)
- Posts are not showing up on particular category
- How to display related posts by subcategory and not parent category
- Restrict post navigation to current sub menu
- Category Template: Need to display different content on first page of archives
- Display post category in foreach loop with category link
- Extracting post categories
- Should I use posts or pages in this scenario?
- Display all posts that were published before full post on single.php
- How to limit posts by category
- Get user categories with most posts in it
- Prepending %category% onto default posts fails
- List all categories with featured image from post?
- Add Read More Tag to a post content (Single.php)
- How to list recent posts in a wp nav menu?
- Dynamic dependent Dropdown lists for categories, sub-categories and posts
- How to display two blog categories as separate sections on one page?
- why does wordpress ignore the post args?
- Thumbnail Image to go in the post aswell
- Is it possible to customize the post according to post format in single.php?
- get posts from Custom Post Type & Category
- How to create a “latest news” page showing a list of posts from blog category
- Defined function isn’t showed on page
- How to enable custom Shortcodes in Post Category Description? [duplicate]
- Sort by last word in title
- How to call posts under a specific category on static front page?
- Give posts a particular template based on the assigned category
- Post-Archive like a page in a specific subdirectory
- How to display only one category in a custom post type?
- Get only X number of categories
- inserting a category into post
- Getting posts from some categories plus some individual posts
- Change layout of post depending on category
- Making a wordpress page print friendly
- latest post showing up twice on posts page
- wp_list_categories() Exclude All Categories Except One
- Different post views for different category views
- “Home” Page now only displaying the single latest post
- Possible?! A contextually titled back link
- Allow / show post comments in category pages
- How to select a category automatically based on a word in WordPress post title?
- Display default matabox of posts(add category) wordpress
- How display related post only in Default category on single
- How to get tags when using publish_post
- How to add class to specific navbar item when post parent category is in specific category
- How do you change the permalink for posts for a single category?
- Posts are not displaying on their category and tag page
- Does having category name in permalinks affect SEO when having a post in multiple categories?
- how to create a category with wp_insert_post and post_category
- Exclude posts in a category on one page but show those posts on a different page
- How to add a block to a category page?
- Excluding category from post navigation in WordPress?
- How do I check if a post is password protected?
- display multiple posts and posts content on a single URL
- Post Category link is same with Page link
- Show custom post category for single post
- Get a list of categories that are related to posts
- Dynamically load posts based on category
- Get Categories & Posts With Type Article
- Querying posts from current category, using a variable as array argument
- Set multi posts random categories and tags
- Precedence of page permalinks over woocommerce product category links?
- Need help writing loop to display posts by categories in separate divs
- Add category selection to function request
- Query post category & remove any post id
- Admin Post List Only Show One Category
- Multiple Post Repeat for Related Post Loop by Category
- Show Post number of specific Category
- Thumbnail With Next/Prev Links Not Showing Next Post?
- Same sidebar in all posts as in the category
- Pagination and Related Posts
- how to show posts on different pages if number of post per page is one
- Single post page from static home not working
- Is possible to create a custom link that creates a post that’s already categorized?
- Is it possible to have different header style blog titles in different categories?
- Category pages vs single post pages
- How to display subcategory articles in the category view?
- How do we display a certain category type on a page while hiding all others?
- Wrap div-tag around posts in page
- Site ‘Categories’: save an admin global setting with post metadata [closed]