• I’ve used several different types of codes to show a list of subcategories when you click on the category page. Here is the one I am currently using:

    <?php wp_list_categories('show_count=1&child_of=255&title_li=Authors P-T'); ?>

    And I produce exactly what I want, except it produces it about ten times.
    https://www.romancefan.org/category/authors/p-t/

    I did a few quick google searches, but apparently I’m the only idiot having this problem. I stripped the category.php of all code relating to listing posts in case it was having issues.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter melissasue

    (@melissasue)

    And here is the full category-255.php page:

    <?php get_header(); ?>
    	<?php if (have_posts()) : ?>
    
    <h2><?php echo single_cat_title(); ?></h2>
    <?php while (have_posts()) : the_post(); ?>
    
    <?php wp_list_categories('show_count=1&child_of=255&title_li=Authors P-T'); ?>
    
    <?php endwhile; ?>
    
    <?php else : ?>
    
    <?php endif; ?>
    
    <?php get_footer(); ?>

    how many posts do you have in category 255?

    your code <?php wp_list_categories('show_count=1&child_of=255&title_li=Authors P-T'); ?> is in the loop and will be repeatedly be shown for each post in the category up to the number you have set in the dashboard under ‘settings’ ‘reading’.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘List of Subcategories Repeats’ is closed to new replies.