Support » Fixing WordPress » Problem: Parent category shows child name

  • Hey guys,

    The problem can be seen here:

    The child categories of ‘all tutorials’ display their name correctly, but oddly when looking at the ‘all tutorials’ category, it displays the name of one of the child categories but I have no idea why.

    Below is the code for this particular section.

    <?php elseif ( is_category() ) : ?>
            	<div class="a-year">
    				foreach((get_the_category()) as $category)
    				  $postcat= $category->cat_ID;
    				  $catname =$category->cat_name;
    				  echo $catname;
                </div><!-- a-year -->
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Problem: Parent category shows child name’ is closed to new replies.