Title: Adding a css dynamic menu&#8230;
Last modified: August 18, 2016

---

# Adding a css dynamic menu…

 *  [cotp](https://wordpress.org/support/users/cotp/)
 * (@cotp)
 * [18 years, 7 months ago](https://wordpress.org/support/topic/adding-a-css-dynamic-menu/)
 * Hello there, I am trying to make a CSS dynamic menu
 * but I have 2 problems:
 * 1) I want to add a class in classes.php at aroubnd line 588 I wrote:
 *     ```
       if ( $cat_name=="My Main Cat 1" ||  $cat_name=="My Main Cat 2"  ||  $cat_name=="My Main Cat 3" ) {
               $link = '<a class="hide" href="' . get_category_link( $category->term_id ) . '" '; }
               else {     $link = '<a href="' . get_category_link( $category->term_id ) . '" ';}
       ```
   
 * But that isn’t really neat and the names can change:
 * Hox could I write:
 * if CATEGORIE = MAIN THEN…
    ELSE …
 * See what I mean ?
 * 2)
    In my header i added: `<link rel="stylesheet" href="<?php bloginfo('template_directory');?
   >/css/ie7menu.css">` but strangely ul and li seem to be styled by default css
 * **Any idea why ?**
 * I also added a div in my sidebar:
 *  ` <div class=”deroul”>
    -  <?php wp_list_categories(‘title_li=’); ?>
 *  </div>`
 * Thanks in advance for your comments 🙂
 * Cotp

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

 *  Thread Starter [cotp](https://wordpress.org/support/users/cotp/)
 * (@cotp)
 * [18 years, 7 months ago](https://wordpress.org/support/topic/adding-a-css-dynamic-menu/#post-643359)
 * Anyone ? 🙁
 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [18 years, 7 months ago](https://wordpress.org/support/topic/adding-a-css-dynamic-menu/#post-643368)
 * If you are doing all that mess just to have a CSS dynamic menu (I think you are
   talking about dynamic highlighting, right?)… then you are overcomplicating it.

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

The topic ‘Adding a css dynamic menu…’ is closed to new replies.

 * 2 replies
 * 2 participants
 * Last reply from: [moshu](https://wordpress.org/support/users/moshu/)
 * Last activity: [18 years, 7 months ago](https://wordpress.org/support/topic/adding-a-css-dynamic-menu/#post-643368)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
