• Resolved wizcomhosting

    (@wizcomhosting)


    Probably a newbie error but frustrating nonetheless.

    If I enable theme support, the photoswipe functionality immediately disappears. How do I put it back?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter wizcomhosting

    (@wizcomhosting)

    Doing my favourite : I found the answer because it was quicker than waiting for someone to hold my newbie hand.

    A more general guide to customising Woocommerce within your own theme would be nice, but I’ll share my findings.

    1. You need all these CSS files;

    //Woocommerce styles
    wp_enqueue_style( 'woocommerce', get_template_directory_uri().'/css/woocommerce.css' );
      wp_enqueue_style( 'woocommerce-layout', get_template_directory_uri().'/css/woocommerce-layout.css' );
      wp_enqueue_style( 'woocommerce', get_template_directory_uri().'/css/woocommerce-smallscreen.css' ); 

    (if you use SASS then make these files the output of your woocommerce sass files – find them in plugins>woocommerce>assets>css). Then you can edit direct.

    2. You need this in your woo commerce functions;

    // disable woocommerce styles
    add_filter( 'woocommerce_enqueue_styles', '__return_empty_array' );
    
    function add_woocommerce_support() {
      add_theme_support( 'woocommerce' );
      add_theme_support( 'wc-product-gallery-zoom' );
      add_theme_support( 'wc-product-gallery-lightbox' );
    }
    
    add_action( 'after_setup_theme', 'add_woocommerce_support' );

    This takes you, essentially to square one and the old rules to modify templates then apply so you can start from a broadly working installation.

    Plugin Support Ryan Ray, a11n

    (@ryanr14)

    Hi there,

    Glad you’d found the solution that works for you. Indeed that extra work is needed depending on how you’ve built the theme. It needs both the script and styles in your case. ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘photoswipe missing when theme support enabled’ is closed to new replies.