• Hi,

    I’m currently working on my first wordpress website and have searched far and wide for answers. I have got 90% of the way however I am having problems with displaying a single sub-catagory.

    I have based my portfolio site similar to the structure of Frisk Design and would like the folio section to be divided up in a similar way (Website design / build, XHTML & CSS, etc.)

    My portfolio page is currently working great however I would like the user to filter the results of the page by the sub-catagories (web, print and other) just as in the Frisk Design example.

    I am truly stuck at this stage… Any help would be greatly appreciated

Viewing 1 replies (of 1 total)
  • Place this code

    <?php if (is_category(12)) { ?>
                <?php
                $cat_object = $wp_query->get_queried_object();
                $parentcat = ($cat_object->category_parent) ? $cat_object->category_parent : $cat;
                wp_list_categories("child_of=$parentcat&title_li=");
                ?>
              <?php } ?>

    after

    <?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
     	  <?php /* If this is a category archive */ if (is_category()) { ?>

    in your archive.php

    make sure you change your portfolio categories id.

    I use this in my portfolio too. It shows the child categories of that parent categories. This should work.

Viewing 1 replies (of 1 total)
  • The topic ‘Displaying a single sub-catagory (excluding the others)’ is closed to new replies.