• Resolved uschu60

    (@uschu60)


    Hi,

    thank you very much for this lovely theme! I like it really much.

    I must dequeue the navigation.js in my child theme but can not figure it out to do it. In Graphy you wrote in the functions.php:

    function graphy_scripts() {
    	wp_enqueue_style( 'graphy-fonts', graphy_fonts_url(), array(), null );
    	wp_enqueue_style( 'graphy-genericons', get_template_directory_uri() . '/genericons/genericons.css', array(), '3.0.3' );
    	wp_enqueue_style( 'graphy-style', get_stylesheet_uri() );
    	if ( 'ja' == get_bloginfo( 'language' ) ) {
    		wp_enqueue_style( 'graphy-style-ja', get_template_directory_uri() . '/css/ja.css' );
    	}
    	wp_enqueue_script( 'graphy-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20140207', true );
    	wp_enqueue_script( 'graphy-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20130115', true );
    	if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
    		wp_enqueue_script( 'comment-reply' );
    	}
    	if ( preg_match( '/MSIE [6-8]/', $_SERVER['HTTP_USER_AGENT'] ) ) {
    		wp_enqueue_script( 'graphy-html5shiv', get_template_directory_uri() . '/js/html5shiv.js', array(), '3.7.0' );
    		wp_enqueue_script( 'graphy-css3-mediaqueries', get_template_directory_uri() . '/js/css3-mediaqueries.js', array(), '20100301' );
    	}
    }
    add_action( 'wp_enqueue_scripts', 'graphy_scripts' );

    I tried to dequeue the part with the ‘graphy-navigation’ only but this does not work. Maybe because I must dequeue the whole ‘graphy_scripts()’?

    Any help is welcome – thank you

    Ute from Germany

Viewing 3 replies - 1 through 3 (of 3 total)
  • Theme Author Takao Utsumi

    (@utsumit)

    Hi uschu60,

    Please write your code. I will check it.

    Thread Starter uschu60

    (@uschu60)

    Hi Takao,

    thank you for you offer. I deleted my try to deregister your part “graphy-navigation” because my php knowledge is very weak – I am still learning 🙂

    Could you write me the neccesary code which I have to implement in my child theme function.php?

    Thank you very much!
    Ute

    Theme Author Takao Utsumi

    (@utsumit)

    From Graphy 2.0.2, you can hide the main navigation (and dequeue navigation.js) in the Customizer. If you’d like to hide the main navigation, I recommend you to use it.
    http://themegraphy.com/documents/graphy/#customization-primary

    If you’d like to dequeue only navigation.js, please write this code to functions.php.

    function graphy_remove_scripts() {
    	wp_dequeue_script( 'graphy-navigation' );
    }
    add_action( 'wp_enqueue_scripts', 'graphy_remove_scripts', 20 );

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

The topic ‘wp_dequeue_script() Graphy navigation’ is closed to new replies.