• cip6791

    (@cip6791)


    I m having a bit of a problem with something. I want to display some categories in the sidebar … but exclude some of them.

    This is what I’m trying.

    <ul class="navmenubar" style="float:left; width:730px;">
    		<?php wp_list_categories('orderby=name&exclude=406'); ?>
    	</ul>

    This is not excluding category with ID 406 and neither is this:

    <?php 
    
    	$hero_args = array(
    		'child_of'                 => 60
    		);
    			$sidebar_heroes = get_categories( $hero_args );
    			//var_dump($sidebar_heroes);
    			echo "<ul>";
    			foreach($sidebar_heroes as $sidebar_hero) {
    
    				echo '<li class="sidebar-category">'.$sidebar_hero->category_nicename.'</li>';
    
    			}
    			echo "</ul>";
    		?>
Viewing 2 replies - 1 through 2 (of 2 total)
  • Michael

    (@alchymyth)

    are these posted codes used in the sidebar?

    are you sure that the sidebar is not using the ‘categories’ widget?

    Thread Starter cip6791

    (@cip6791)

    I took out the widget.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Displaying categories’ is closed to new replies.