WordPress.org

Support

Support » How-To and Troubleshooting » Problem: Parent category shows child name

Problem: Parent category shows child name

  • Hey guys,

    The problem can be seen here: http://alihitch.com/category/all-tutorials/

    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">
    
                <h2>
    			<?php
    				foreach((get_the_category()) as $category)
    					{
    				  $postcat= $category->cat_ID;
    				  $catname =$category->cat_name;
    
    				  echo $catname;
    				}
    			?>
    			</h2>
    
                </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.