Support » Themes and Templates » is_category not working in sidebar.php

  • Hi,
    I want to use is_category function in sidebar.php. Here is my code:

      <li><a <?php if (is_home()) echo 'id="selected"';?> href="<?php bloginfo('url')?>">Home</a></li>
      <li><a <?php if (is_page('essays')) echo 'id="selected"';?> href="<?php bloginfo('url')?>/essays">Essays</a></li>
          <?php if (is_page('essays') || is_category()):?>
              <ol id="submenu">
                    <?php wp_list_categories('hide_empty=0&child_of=3&title_li=')?>
          <?php endif?>
      <li><a <?php if (is_page('books')) echo 'id="selected"';?> href="<?php bloginfo('url')?>/books">Books</a></li>

    Actually I want show sub menu in the ‘essays’ page and in the categories. So if user open categories ‘A’ the submenu being showed.


Viewing 1 replies (of 1 total)
  • I could not found anything about this in documentation. But does somebody know that is_category could work in sidebar.php or not?

Viewing 1 replies (of 1 total)
  • The topic ‘is_category not working in sidebar.php’ is closed to new replies.