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, add the php code below.

Please read this article on How to add custom PHP code to your theme.
We HIGHLY recommend using a child theme. See the article above to know how to do this.

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;
}