Compatibility with Visual Composer plugin

Visual Composer is a very popular premium plugin used for building page layouts. Unfortunately, at the time of writing this article, VC still uses an older version of waypoints.jquery library. Our themes use the same library as well, but since VC is loaded first, wphoot themes skips loading the updated waypoints library bundled in the theme.

Due to this, you will notice that the sticky header feature in our themes simply wont work.

To solve this, simply upload and activate Hoot VisualComposer plugin.

* Alternately, if you are using a child theme, instead of adding the above plugin, you can simply add the php code below to the child theme’s functions.php file.

add_action( 'wp_enqueue_scripts', 'hoot_child_enqueue_wp_styles_scripts', 101 );
function hoot_child_enqueue_wp_styles_scripts() {
    wp_deregister_script( 'waypoints' );
    wp_dequeue_script( 'waypoints-sticky' );
    if ( function_exists( 'hoot_locate_script' ) ) :
      $script_uri = hoot_locate_script( trailingslashit( HOOT_JS ) . 'jquery.waypoints' );
      wp_enqueue_script( 'waypoints', $script_uri, array( 'jquery' ), '3.1.0', true );
      $script_uri = hoot_locate_script( trailingslashit( HOOT_JS ) . 'sticky' );
      wp_enqueue_script( 'waypoints-sticky', $script_uri, array( 'jquery', 'waypoints' ), '3.1.0', true );
    else:
      $script_uri = hybridextend_locate_script( HYBRIDEXTEND_JS . 'jquery.waypoints' );
      wp_enqueue_script( 'waypoints', $script_uri, array( 'jquery' ), '3.1.0', true );
      $script_uri = hybridextend_locate_script( HYBRIDEXTEND_JS . 'sticky' );
      wp_enqueue_script( 'waypoints-sticky', $script_uri, array( 'jquery', 'waypoints' ), '3.1.0', true );
    endif;
}