Skip to main content
added 1 character in body
Source Link
88 MPG
  • 133
  • 8

I found this post, but it was never answered. I'm looking for the same thing, haven't been able to find a solution so far.

My problem is that I can't find a way to list subcategories unique to each post on a category archive page. My markup is currently this:

<article <?php post_class( 'grid_item' ); ?>>
  <div class="grid_item--inner">
    <?php the_post_thumbnail(); ?>
    <header>
      <a class="cat_card--link" href="<?php the_permalink(); ?>">
        <h2 class="cat_card--title"><?php the_title(); ?></h2>
        <?php get_template_part('templates/entry-meta'); ?>
      </a>
    </header>
    <div class="cat_card--cats">
      <?php wp_list_categories('title_li=&style=none'); ?>
    </div>
  </div>
</article>

This of course will list all subcategories of the current page's category. Looking through the WP codex documentation, I haven't been able to find a way to list only the applicable subcategories of each post. Is this possible? If so, how do I achieve this?

EDIT: To clarify, I'm interested in listing each subcategory like so:

ParetParent Category: "Video"
  - Post 1: Subcategory "Comedy"
  - Post 2: Subcategory "Action"
  - Post 3: Subcategories "Comedy, Action"

Where each post only lists the subcategories it uses.

I found this post, but it was never answered. I'm looking for the same thing, haven't been able to find a solution so far.

My problem is that I can't find a way to list subcategories unique to each post on a category archive page. My markup is currently this:

<article <?php post_class( 'grid_item' ); ?>>
  <div class="grid_item--inner">
    <?php the_post_thumbnail(); ?>
    <header>
      <a class="cat_card--link" href="<?php the_permalink(); ?>">
        <h2 class="cat_card--title"><?php the_title(); ?></h2>
        <?php get_template_part('templates/entry-meta'); ?>
      </a>
    </header>
    <div class="cat_card--cats">
      <?php wp_list_categories('title_li=&style=none'); ?>
    </div>
  </div>
</article>

This of course will list all subcategories of the current page's category. Looking through the WP codex documentation, I haven't been able to find a way to list only the applicable subcategories of each post. Is this possible? If so, how do I achieve this?

EDIT: To clarify, I'm interested in listing each subcategory like so:

Paret Category: "Video"
  - Post 1: Subcategory "Comedy"
  - Post 2: Subcategory "Action"
  - Post 3: Subcategories "Comedy, Action"

Where each post only lists the subcategories it uses.

I found this post, but it was never answered. I'm looking for the same thing, haven't been able to find a solution so far.

My problem is that I can't find a way to list subcategories unique to each post on a category archive page. My markup is currently this:

<article <?php post_class( 'grid_item' ); ?>>
  <div class="grid_item--inner">
    <?php the_post_thumbnail(); ?>
    <header>
      <a class="cat_card--link" href="<?php the_permalink(); ?>">
        <h2 class="cat_card--title"><?php the_title(); ?></h2>
        <?php get_template_part('templates/entry-meta'); ?>
      </a>
    </header>
    <div class="cat_card--cats">
      <?php wp_list_categories('title_li=&style=none'); ?>
    </div>
  </div>
</article>

This of course will list all subcategories of the current page's category. Looking through the WP codex documentation, I haven't been able to find a way to list only the applicable subcategories of each post. Is this possible? If so, how do I achieve this?

EDIT: To clarify, I'm interested in listing each subcategory like so:

Parent Category: "Video"
  - Post 1: Subcategory "Comedy"
  - Post 2: Subcategory "Action"
  - Post 3: Subcategories "Comedy, Action"

Where each post only lists the subcategories it uses.

further clarification
Source Link
88 MPG
  • 133
  • 8

I found this post, but it was never answered. I'm looking for the same thing, haven't been able to find a solution so far.

My problem is that I can't find a way to list subcategories unique to each post on a category archive page. My markup is currently this:

<article <?php post_class( 'grid_item' ); ?>>
  <div class="grid_item--inner">
    <?php the_post_thumbnail(); ?>
    <header>
      <a class="cat_card--link" href="<?php the_permalink(); ?>">
        <h2 class="cat_card--title"><?php the_title(); ?></h2>
        <?php get_template_part('templates/entry-meta'); ?>
      </a>
    </header>
    <div class="cat_card--cats">
      <?php wp_list_categories('title_li=&style=none'); ?>
    </div>
  </div>
</article>

This of course will list all subcategories of the current page's category. Looking through the WP codex documentation, I haven't been able to find a way to list only the applicable subcategories of each post. Is this possible? If so, how do I achieve this?

EDIT: To clarify, I'm interested in listing each subcategory like so:

Paret Category: "Video"
  - Post 1: Subcategory "Comedy"
  - Post 2: Subcategory "Action"
  - Post 3: Subcategories "Comedy, Action"

Where each post only lists the subcategories it uses.

I found this post, but it was never answered. I'm looking for the same thing, haven't been able to find a solution so far.

My problem is that I can't find a way to list subcategories unique to each post on a category archive page. My markup is currently this:

<article <?php post_class( 'grid_item' ); ?>>
  <div class="grid_item--inner">
    <?php the_post_thumbnail(); ?>
    <header>
      <a class="cat_card--link" href="<?php the_permalink(); ?>">
        <h2 class="cat_card--title"><?php the_title(); ?></h2>
        <?php get_template_part('templates/entry-meta'); ?>
      </a>
    </header>
    <div class="cat_card--cats">
      <?php wp_list_categories('title_li=&style=none'); ?>
    </div>
  </div>
</article>

This of course will list all subcategories of the current page's category. Looking through the WP codex documentation, I haven't been able to find a way to list only the applicable subcategories of each post. Is this possible? If so, how do I achieve this?

I found this post, but it was never answered. I'm looking for the same thing, haven't been able to find a solution so far.

My problem is that I can't find a way to list subcategories unique to each post on a category archive page. My markup is currently this:

<article <?php post_class( 'grid_item' ); ?>>
  <div class="grid_item--inner">
    <?php the_post_thumbnail(); ?>
    <header>
      <a class="cat_card--link" href="<?php the_permalink(); ?>">
        <h2 class="cat_card--title"><?php the_title(); ?></h2>
        <?php get_template_part('templates/entry-meta'); ?>
      </a>
    </header>
    <div class="cat_card--cats">
      <?php wp_list_categories('title_li=&style=none'); ?>
    </div>
  </div>
</article>

This of course will list all subcategories of the current page's category. Looking through the WP codex documentation, I haven't been able to find a way to list only the applicable subcategories of each post. Is this possible? If so, how do I achieve this?

EDIT: To clarify, I'm interested in listing each subcategory like so:

Paret Category: "Video"
  - Post 1: Subcategory "Comedy"
  - Post 2: Subcategory "Action"
  - Post 3: Subcategories "Comedy, Action"

Where each post only lists the subcategories it uses.

Source Link
88 MPG
  • 133
  • 8

Category Archive, list subcategories of each post

I found this post, but it was never answered. I'm looking for the same thing, haven't been able to find a solution so far.

My problem is that I can't find a way to list subcategories unique to each post on a category archive page. My markup is currently this:

<article <?php post_class( 'grid_item' ); ?>>
  <div class="grid_item--inner">
    <?php the_post_thumbnail(); ?>
    <header>
      <a class="cat_card--link" href="<?php the_permalink(); ?>">
        <h2 class="cat_card--title"><?php the_title(); ?></h2>
        <?php get_template_part('templates/entry-meta'); ?>
      </a>
    </header>
    <div class="cat_card--cats">
      <?php wp_list_categories('title_li=&style=none'); ?>
    </div>
  </div>
</article>

This of course will list all subcategories of the current page's category. Looking through the WP codex documentation, I haven't been able to find a way to list only the applicable subcategories of each post. Is this possible? If so, how do I achieve this?