WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How to show only child_of for parent? (2 posts)

  1. davincim
    Member
    Posted 5 years ago #

    My archives pages are only showing one child category at a time. I'd rather have them show all the child categories within the parent category.

    I found the "child_of" parameter, but not sure where to place it in my code. Each child category only has one post assigned to it. The reasoning is as follows: browse by brand > brands > product.

    My site is http://www.ammunitionstorage.net/category/by-brand/

    My code is:

    <ul class="wpn_archives">
    <?php while (have_posts()) : the_post(); ?>
    <li>
    <img class="wpn_thumb" src="<?php echo get_post_meta($post->ID, "thumbnail", true); ?>" alt="" />
    <!--<a class="wpn_comments" href="<?php the_permalink(); ?>#comments"><?php comments_number('0', '1', '%'); ?></a>-->
    <h2><a href="<?php the_permalink(); ?>"><?php category_title(get_the_title()); ?></a></h2>
    <span>Product inventory is continuously updated</span>
    <!--<span>Published on <?php the_time('l, F j, Y') ?> by <?php the_author_posts_link() ?></span>-->
    <!--<?php wpn_content_show(370); ?>-->
    <a href="<?php the_permalink(); ?>">Read More &raquo;</a>
    </li>
    <?php endwhile; ?>

    The "by brand" is only one such category, so I need all parent categories to show their children.

    Any help is very much appreciated.

  2. davincim
    Member
    Posted 5 years ago #

    Found solution for code, so changed my strategy by reducing the number of child categories.

Topic Closed

This topic has been closed to new replies.

About this Topic