Sub-catergory question

Discussion in 'WordPress' started by bob25, May 4, 2012.

  1. #1
    Is there a way to structure it so the post for the sub-category doesn't appear on the "upper" category?

    For instance, I have a top level category and a sub-category under it. However, the posts I make in the sub-category also appears in the top category. What I want is the post to go into the correct category only.

    Is there some way to structure it, or some plugin that will do this?

    Thanks
     
    bob25, May 4, 2012 IP
  2. ColorVila

    ColorVila Greenhorn

    Messages:
    55
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    18
    #2
    Use wp_list_categories function with 'depth' parameter.


    <ul> <?php wp_list_categories('depth=1'); ?></ul>
     
    ColorVila, May 4, 2012 IP
  3. bob25

    bob25 Well-Known Member

    Messages:
    1,519
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    128
    #3
    You lost me there (not very hard to do :confused:). I assume you mean I need to edit a template? If so, can you give a hint which one it might be, and where to put the code. I know how to "drive the car" so to speak, but other than that my knowledge of WP is very limited.

    Thanks
     
    bob25, May 4, 2012 IP
  4. ColorVila

    ColorVila Greenhorn

    Messages:
    55
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    18
    #4
    first, you should know which template file to edit, maybe category.php or index.php(it depends on the hierarchy of WordPress theme file), then go inside the file to find the loop, modify the code.
    If you're not familiar with that, I think it's better to get somebody do that for you.

    Or can you post the theme files structure here(just a screenshot of your theme file directory)? and also your site url. So I can point out where and how to modify the code.
     
    ColorVila, May 5, 2012 IP
  5. bob25

    bob25 Well-Known Member

    Messages:
    1,519
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    128
    #5
    I hope this image gets posted right, it's the first time I tried. Anyway it's a premium theme so there's no category file, and I tried using my browsers search function to try and find "depth", but the only one I could find was functions.php (I think)

    Thanks
     

    Attached Files:

    bob25, May 5, 2012 IP
  6. ColorVila

    ColorVila Greenhorn

    Messages:
    55
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    18
    #6
    It's not the functions.php, I can't see the image clearly, too small.
    Though it's a premium theme, I think you also can contact the designer for help.
     
    ColorVila, May 6, 2012 IP
  7. bob25

    bob25 Well-Known Member

    Messages:
    1,519
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    128
    #7
    Okay, thanks for trying
     
    bob25, May 6, 2012 IP