Forums

Page displays 'no categories', wp_list_categories () (6 posts)

  1. rayholt
    Member
    Posted 2 years ago #

    I'm having a problem with displaying categories. In the top navigation, as well as the sub navigation, it displays "no categories". I don't know if I just need another set of eyes looking at it because I can't seem to find any errors. Below is the code.

    <div id="navbar">
    
    	<div id="navbarleft">
    		<ul id="nav">
    			<li><a href="<?php echo get_settings('home'); ?>">Home</a></li>
    			<?php wp_list_categories('exclude=1,3,5,4,9,11,12,14,15&orderby=order&hierarchical=1&depth=3&title_li='); ?><?php wp_list_pages('title_li=&depth=4&sort_column=menu_order'); ?>
    
    		</ul>
    	</div>
    
    	<div id="navbarright">
    		<form id="searchform" method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>">
    		<input type="text" value="Search this website..." name="s" id="searchbox" onfocus="if (this.value == 'Search this website...') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Search this website...';}" />
    		<input type="submit" id="searchbutton" value="GO" /></form>
    	</div>
    
    </div>
    
    <div style="clear:both;"></div>
    
    <div id="subnavbar">
    
    	<ul id="subnav">
    		<?php wp_list_categories('exclude=1,3,4,5,7,8,10,13&orderby=order&hierarchical=1&depth=3&title_li='); ?>
    	</ul>
    
    </div>
  2. MichaelH
    Volunteer
    Posted 2 years ago #

    If you put this in your sidebar.php or in Otto's PHP Code Widget do you get results?

  3. rayholt
    Member
    Posted 2 years ago #

    Just tried and still showed "no categories" in the sidebar.

  4. rayholt
    Member
    Posted 2 years ago #

    Although, I can go into Widgets and drag and drop the Categories widget into the defined sidebar and it works then.

  5. MichaelH
    Volunteer
    Posted 2 years ago #

    Actually I meant this code to be in a code widget

    <?php wp_list_categories('exclude=1,3,5,4,9,11,12,14,15&orderby=order&hierarchical=1&depth=3&title_li='); ?>
  6. rodrigomattos
    Member
    Posted 2 years ago #

    How do I show a category instead of NO CATEGORIES?

Topic Closed

This topic has been closed to new replies.

About this Topic