Support » Themes and Templates » Using get_categories Shows Multiple Of The Same Category

  • I just finished using the get_categories function in the sidebar, and it looks like this:

    <h4>Categories</h4>
    <ul>
    <?php
    	$args = array(
    		'type' => 'post'
    	);
    	$categories = get_categories($args);
    	foreach ($categories as $cat) {
    		$option .= '<li><a href="/category/';
    		$option .= $cat->cat_name;
    		$option .= '">';
    		$option .= $cat->cat_name;
    		$option .= '</a></li>';
    		echo $option;
    	}
    ?>
    </ul>

    It works and all, but shows multiple of the same category. Take a look: http://www.ju1c3.com

    Anyone know why?

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Using get_categories Shows Multiple Of The Same Category’ is closed to new replies.