• Hello

    I am having issue in display of Genesis Responsive Slider on the top section of the homepage of my website MG Tools. It was working fine until I installed WooCommerce plugin.

    I am getting this notice on my website.
    Notice: Undefined index: title in /hermes/bosnaweb20a/b2498/ipg.greeninvitescom1/wp-content/plugins/genesis-responsive-slider/genesis-responsive-slider.php on line 227

    If I deactivate the WooCommerce plugin, the slider shows but the Notice with error is still there.

    Please advice.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Nick C

    (@modernnerd)

    Hi, @yashitamittal11.

    If you give your slider widget a title in Appearance → Widgets, does this clear the error?

    Thread Starter yashitamittal11

    (@yashitamittal11)

    Hi

    Yes, giving the slider widget title, clears up the error. Thanks.

    But the slider is still not displaying

    Thread Starter yashitamittal11

    (@yashitamittal11)

    Genesis Responsive Slider is still not displaying. Upon searching I found that, WooCommerce interferes with the sliders sometimes.
    So I want to conditionally load the WooCommerce scripts and styles.
    I have found the handle of all the scripts and styles loaded using the code:

    # Finding handle for your plugins

    function display_script_handles() {
        global $wp_scripts;
    	if(current_user_can('manage_options') && ! is_admin()){ # Only load when user is admin
    	foreach( $wp_scripts->queue as $handle ) :
             $obj = $wp_scripts->registered [$handle];
             echo $filename = $obj->src;
    		 echo ' : <b>Handle for this script is:</b> <span style="color:green"> '.$handle.'</span><br/><br/>';
    	endforeach;
    	}	
    }
    add_action( 'wp_print_scripts', 'display_script_handles' );

    Script Handles found for WooCommerce:

    Handle: wc-add-to-cart
    Handle: woocommerce
    Handle: wc-cart-fragments
    Handle: flexslider

    Style Handles found for WooCommerce:

    Handle: woocommerce-layout
    Handle: woocommerce-smallscreen
    Handle: woocommerce-general
    Handle: genesis-sample-woocommerce-styles

    I am trying to remove these WooCommerce handles conditionally using the code:

    add_action( 'wp_enqueue_scripts', 'child_manage_woocommerce_styles', 99 );
     
    function child_manage_woocommerce_styles() {
        //remove generator meta tag
        remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) );
    
        //first check that woo exists to prevent fatal errors
        if ( function_exists( 'is_woocommerce' ) ) {
           //dequeue scripts and styles
           if ( ! is_woocommerce() && ! is_cart() && ! is_checkout() ) {
               wp_dequeue_script( 'wc-add-to-cart' );
               wp_dequeue_script( 'wc-cart-fragments' );
               wp_dequeue_script( 'woocommerce' );
               wp_dequeue_script( 'flexslider' );
    
               wp_dequeue_style('woocommerce-layout');
               wp_dequeue_style('woocommerce-smallscreen');
               wp_dequeue_style('woocommerce-general');
               wp_dequeue_style('genesis-sample-woocommerce-styles');
           }
        }
    }
    

    Even after removing all the WooCommerce scripts and styles on the homepage, Genesis responsive slider is not working.

    Please suggest what can be the issue.

    Thread Starter yashitamittal11

    (@yashitamittal11)

    I have identified the issue.
    When WooCommerce is deactivated, following scripts load (View-Developer-Source)

    <script type='text/javascript' src='https://localhost/wp-content/plugins/genesis-responsive-slider/js/jquery.flexslider.js?ver=0.9.5'></script>

    And when WooCommerce is activated, following scripts load,
    <script type='text/javascript' src='//localhost/wp-content/plugins/woocommerce/assets/js/flexslider/jquery.flexslider.min.js?ver=2.6.1'></script>

    As the jquery.flexslider.js for Genesis Responsive slider does not load when WooCommerce is activated, the slider does not work.
    So, I have dequeued the Woocommerce flexslider, wp_dequeue_script( 'flexslider' );
    I manually copied the js for Genesis Responsive slider in my theme and included in
    wp_enqueue_script( 'genesis-res-slider', get_stylesheet_directory_uri() . "/js/jquery.flexslider.js", array( 'jquery' ), CHILD_THEME_VERSION, true );

    Now the slider is working fine.
    Please tell me a clean way to include the js for Genesis Responsive slider. Do I need to do it manually.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Genesis slider does not display’ is closed to new replies.