Title: customizing html in PHP menu constructor
Last modified: August 19, 2016

---

# customizing html in PHP menu constructor

 *  [stabilimenta](https://wordpress.org/support/users/stabilimenta/)
 * (@stabilimenta)
 * [17 years, 1 month ago](https://wordpress.org/support/topic/customizing-html-in-php-menu-constructor/)
 * I am creating a custom theme for a client and am having trouble figuring out 
   how to wrap a `<div>` around the top level link, and wrap the linked text in 
   a span, but **only for the parent pages** in my navigation menu, like this
 *     ```
       <li id=&quot;community&quot;>
       	<div class=&quot;parent&quot;>
       		<a href=&quot;#&quot;><span>Top Level Page 1</span></a>
       	</div>
   
       	<ul>
       		<li><a href=&quot;#&quot;&quot;>Sub Page 1</a></li>
       	</ul>
       </li>
       ```
   
 * I’m a designer, and know very little about PHP constuctors.
 * I am working in the classes.php, but can’t figure out how to get it to treat 
   the parents differently from the children. Can anyone offer me some guidance.
   
   Thank you,

The topic ‘customizing html in PHP menu constructor’ is closed to new replies.

 * 0 replies
 * 1 participant
 * Last reply from: [stabilimenta](https://wordpress.org/support/users/stabilimenta/)
 * Last activity: [17 years, 1 month ago](https://wordpress.org/support/topic/customizing-html-in-php-menu-constructor/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
