• WP-Supersized version 3.1.5

    Hi guys,

    I’m trying to make the products single view page to use wp-supersized from displaying the product images, pulled from wp media gallery (custom post type ‘product’ in woocommerce). Product images should be ‘fit always’ to avoid cropping. I got this working (thanks to the custom post type thread here).

    The whole website is also using wp-supersized for the large image background stretched across the screen by choosing ‘always fill screen’.

    https://saintmontys.com/indyk/

    The problem is I can’t change the ‘fit image’ option differently from other pages and post types.

    I tried to play with XML file options but the problem with this approach is:
    – I can’t set it up on the front page
    – I don’t want to set it up for each post/page manually individually. It has to have a default (less work).
    – Choosing XML file in the products pages will not use the wp media gallery. I need it to pull images from what is attached to the posts.

    Is there a way to make it default to ‘always fill screen’ on everything, except on product pages where I want it ‘fit always’? Thanks!

    https://www.ads-software.com/extend/plugins/wp-supersized/

Viewing 1 replies (of 1 total)
  • In case anyone needs similar, I used a different approach with the product images. Supersized is still used on all pages, but NOT in the product pages. I used action hooks to disable the plugin on the product pages:

    // Disable WP Supersized on single product view page
    		if ( class_exists( 'WPSupersized' ) ) {
    			remove_action('init', array('WPSupersized','initialize'));
    			remove_action('admin_menu', array('WPSupersized','add_menu_item'));
    			remove_filter('plugin_action_links_wp-supersized/index.php',array('WPSupersized','add_plugin_settings_link'), 10, 2 );
    			remove_action('wp_print_scripts', array('WPSupersized','_Supersized_scripts'));
    			remove_action('wp_print_styles', array('WPSupersized','_Supersized_styles'));
    			remove_action('wp_head', array('WPSupersized','addHeaderCode'));
    			remove_action('wp_footer', array('WPSupersized','addFooterCode'), 15);
    		}

    And I moved the main image outside the content area to make it as background via CSS:

    // Move the product main thumb in single product view page
    		remove_action( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_images', 20 );
    		add_action( 'wp_footer', 'woocommerce_show_product_images', 5 );
    		// Move the thumbnails
    		remove_action( 'woocommerce_product_thumbnails', 'woocommerce_show_product_thumbnails', 20 );
    		add_action( 'woocommerce_after_single_product_summary', 'woocommerce_show_product_thumbnails', 20 );

    P.S. The custom post type thread I was talking about was https://www.ads-software.com/support/topic/plugin-wp-supersized-custom-post-type

Viewing 1 replies (of 1 total)
  • The topic ‘Always Fill Screen on pages/posts, Fit Always on product view’ is closed to new replies.