Support » Fixing WordPress » Can’t change wp_list_categories in sidebar.php

  • Hello, thanks in advance for your help. I have searched the forums, bug reports and other resources before asking this question and was unable to find an answer.

    I have a long list of categories, and wanted to experiment with some restrictions but I found that any changes I made to any code in the following block had zero effect and resulted in the regular list headed “Categories” that displays all categories:

    <!-- sidebar east START -->
    	<div id="eastsidebar" class="sidebar">
    	<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('east_sidebar') ) : ?>
    		<!-- categories -->
    		<div class="widget widget_categories">
    			<div class="content">
    					<?php wp_list_categories('exclude=5'); ?>
    	<?php endif; ?>
    	<!-- sidebar east END -->

    No change to anything anywhere in this block of code in sidebar.php has any effect or results in anything but the regular listing. Even changing <h3>Categories</h3> to <h3>Schmattergories</h3> has no effect, and the heading is still “Categories”. Deleting <?php wp_list_categories('exclude=5'); ?> has no effect, they still display. Yet deleting that entire block of code, everything in between the comment tags, DOES result in no categories nor the categories heading being displayed.

    Yet any change to the code right below, `<!– sidebar west START –>
    <div id=”westsidebar” class=”sidebar”>
    <?php if ( !function_exists(‘dynamic_sidebar’) || !dynamic_sidebar(‘west_sidebar’) ) : ?>

    <!– archives –>
    <div class=”widget widget_archive”>
    <div class=”content”>

      <?php wp_get_archives(‘type=yearly’); ?>


    <?php endif; ?>
    <!– sidebar west END –>` shows up immediately. Renaming the heading, adding conditions to the function call, everything shows up immediately.

    I am running WP Supercache, but turned it off and manually deleted all cache files to test these changes. Any ideas?

Viewing 1 replies (of 1 total)
  • Do you have any widgets activated on that first sidebar?

    This line of code

    <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('east_sidebar') ) : ?>

    means that if there are any widgets active, the code that follows the IF statement up through the closing of the IF statement, is not going to run.

Viewing 1 replies (of 1 total)
  • The topic ‘Can’t change wp_list_categories in sidebar.php’ is closed to new replies.