Title: Inserting &#039;onclick event&#039; code into theme?
Last modified: August 21, 2016

---

# Inserting 'onclick event' code into theme?

 *  [malcoreilly](https://wordpress.org/support/users/malcoreilly/)
 * (@malcoreilly)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/inserting-onclick-event-code-into-theme/)
 * Hi anyone who can help: I am trying to edit my Twenty Eleven theme to follow 
   these guidelines from MS re touch events: [http://msdn.microsoft.com/en-us/library/ie/jj152135(v=vs.85)](http://msdn.microsoft.com/en-us/library/ie/jj152135(v=vs.85)).
   aspx
    Thankfully, I found a blog post on MSDN ([http://blogs.msdn.com/b/notime/archive/2013/02/01/how-to-optimize-wordpress-popup-on-hover-menus-for-touch-devices.aspx](http://blogs.msdn.com/b/notime/archive/2013/02/01/how-to-optimize-wordpress-popup-on-hover-menus-for-touch-devices.aspx))
   which explained how to implement aria haspopup. This seems to work fine on everything–
   most importantly my Windows Phone! But I wonder what is the method for the ‘onclick’
   event mentioned in the article? I’ve got pretty limited coding skills, though…
   Thanks in advance.

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

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/inserting-onclick-event-code-into-theme/#post-4314747)
 * Do not edit the Twenty Eleven theme itself. First [create a child theme for your changes](http://codex.wordpress.org/Child_Themes).
 *  Thread Starter [malcoreilly](https://wordpress.org/support/users/malcoreilly/)
 * (@malcoreilly)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/inserting-onclick-event-code-into-theme/#post-4314799)
 * Hiya, thanks for replying! Yep, fair point, I should backup and make a child 
   theme instead – thanks for reminding me. This is a new site and I’m pretty keen
   to get it up and running soon (replaces an old Joomla site) [http://www.arcguiding.com/blog](http://www.arcguiding.com/blog).
   Do you know how / where I modify the css in the child theme, that codes for the
   dropdown itself (I think its the standard styling of the template)? Looks like
   I need to change the dimensions, as it runs off the edge of the phone screen.
   Using the aria haspopup means a second touch closes the menu before you can scroll
   the screen… Thanks again

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

The topic ‘Inserting 'onclick event' code into theme?’ is closed to new replies.

## Tags

 * [menu](https://wordpress.org/support/topic-tag/menu/)
 * [onclick](https://wordpress.org/support/topic-tag/onclick/)
 * [touch](https://wordpress.org/support/topic-tag/touch/)

 * 2 replies
 * 2 participants
 * Last reply from: [malcoreilly](https://wordpress.org/support/users/malcoreilly/)
 * Last activity: [12 years, 7 months ago](https://wordpress.org/support/topic/inserting-onclick-event-code-into-theme/#post-4314799)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
