Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 2 of 2
  1. #1
    Junior Member andrewreff's Avatar
    Join Date
    Sep 2010
    Location
    Indianapolis
    Posts
    20
    Member #
    23933
    Ok, so here is my issue that I am working on and trying to figure out;

    I have set up in my Wordpress theme both a category.php and a category-portfolio.php. The intention is so that anything in or falling within that category would display using the second template. There are sub-categories under portfolio that certain posts are marked as. My understanding was anything that would fall under a particular category would inherit it's parents template, however it is not and it is just referring to the category.php template.

    Any ideas or suggestions to get the sub-categories under portfolio to show up using the same template as the parent category would be using?

  2.  

  3. #2
    Junior Member
    Join Date
    Oct 2010
    Posts
    26
    Member #
    24200
    Liked
    1 times
    The way I do this is like:

    PHP Code:
    <?php
    $post 
    $wp_query->post;
    if ( 
    in_category('6') || in_category('3') ) {
    include(
    TEMPLATEPATH '/template.php');

    } else {
    include(
    TEMPLATEPATH '/subtemplate.php');
    }
    ?>


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Search tags for this page

how do i create a subcategory for a wordpress page

,

page template subcategory wordpress

,

wordpress show subcategories on page

,

wordpress template for sub category

Click on a term to search for related topics.
All times are GMT -6. The time now is 08:21 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com