[wp-trac] [WordPress Trac] #22307: Twenty Twelve: JavaScript error if navigation wrapper markup is removed from header

WordPress Trac noreply at wordpress.org
Mon Oct 29 19:19:33 UTC 2012


#22307: Twenty Twelve: JavaScript error if navigation wrapper markup is removed
from header
---------------------------+------------------
 Reporter:  sswells        |       Owner:
     Type:  defect (bug)   |      Status:  new
 Priority:  normal         |   Milestone:  3.5
Component:  Bundled Theme  |     Version:
 Severity:  normal         |  Resolution:
 Keywords:  has-patch      |
---------------------------+------------------

Comment (by DrewAPicture):

 @sswells: One of the most painless ways to avoid this kind of thing in the
 future to is to make sure you just dequeue any scripts from the parent
 theme you won't be using. In this case, you could use something like this
 in your child theme's functions file:
 {{{
 function dequeue_unneeded_scripts() {
         wp_dequeue_script( 'twentytwelve-navigation' );
 }
 add_action( 'wp_enqueue_scripts', 'dequeue_unneeded_scripts' );
 }}}

 This way, you're free to take out the navigation markup or leave it in,
 reuse it for a different type of nav, etc. And no JS errors :)

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/22307#comment:7>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list