Title: Help with adding Javascript to PHP code
Last modified: August 19, 2016

---

# Help with adding Javascript to PHP code

 *  [wmakara](https://wordpress.org/support/users/wmakara/)
 * (@wmakara)
 * [17 years ago](https://wordpress.org/support/topic/help-with-adding-javascript-to-php-code/)
 * Hi,
 * I have created a drop down menu through Fireworks and would like to apply it 
   to my header menu. The header menus are made up of my categories so I only want
   this drop down menu to apply to one category that has children categories.
 * My files are called mm_css_menu.js and header_menu.css
 * The PHP code that is for the header menu is as follows:
 *     ```
       <div id="header-menu">
       <ul>
       <?php if (is_home()) { ?>
       <li class="current_page_item"><a href="<?php echo get_option('home'); ?>/">Home</a></li>
       <?php } else { ?>
       <li><a href="<?php echo get_option('home'); ?>/">Home</a></li>
       <?php } ?>
       <?php wp_list_categories('sort_column=name&amp;title_li=&amp;depth=3'); ?>
       </ul>
       </div>
       ```
   
 * I just need to be pointed out what I need to add to display children categories
   and where to add the javascript code.
 * Am I correct in thinking this is the Javascript code I need to add in:
 *     ```
       <script type="text/javascript" src="mm_css_menu.js"></script>
       <link rel="stylesheet" href="header_menu.css" type="text/css" />
       ```
   
 * The menu item is Products that needs the drop down menu if you need to see my
   site it’s [http://abcbabyland.com/blog/](http://abcbabyland.com/blog/)
 * Thanks for all your help.
 * Wendy

The topic ‘Help with adding Javascript to PHP code’ is closed to new replies.

 * 0 replies
 * 1 participant
 * Last reply from: [wmakara](https://wordpress.org/support/users/wmakara/)
 * Last activity: [17 years ago](https://wordpress.org/support/topic/help-with-adding-javascript-to-php-code/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
