| 开发者 |
deanoakley
jinksi |
|---|---|
| 更新时间 | 2026年10月13日 14:01 |
| 捐献地址: | 去捐款 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.0 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
[product_page] shortcodewooswipe_before_main — before the gallery markupwooswipe_after_thumbs — after the thumbnail stripwooswipe_after_main — after the full gallerywooswipe_zoomed_image_size — lightbox / zoom image size (default roughly 1920×1080)wooswipe_include_attachment — return false to exclude an attachment from the gallerywooswipe_is_block_gallery — return true/false to force block-theme (full-width-in-column) vs classic two-column layoutwoocommerce_single_product_image_thumbnail_html — returning an empty string for an attachment also excludes it from the main image and thumbs (see FAQ)add_filter( 'wooswipe_zoomed_image_size', 'wooswipe_max_image_size', 10, 1 ); function wooswipe_max_image_size( $size ) { return 'large'; }
More info: WooSwipe on Thrive · GitHub
/wooswipe/ to the /wp-content/plugins/ directory, or install from Plugins → Add New.Use this in your theme’s functions.php or a code-snippets plugin. WooSwipe respects it for both the main image and thumbnails (from 3.0.9):
function remove_featured_image( $html, $attachment_id ) { global $post; if ( ! $post ) { return $html; } $featured_image = get_post_thumbnail_id( $post->ID ); if ( (int) $attachment_id === (int) $featured_image ) { $html = ''; } return $html; } add_filter( 'woocommerce_single_product_image_thumbnail_html', 'remove_featured_image', 10, 2 );
Or use the WooSwipe-specific filter:
add_filter( 'wooswipe_include_attachment', function( $include, $attachment_id ) { global $post; if ( $post && (int) $attachment_id === (int) get_post_thumbnail_id( $post->ID ) ) { return false; } return $include; }, 10, 2 );
When the featured image is excluded, WooSwipe uses the first gallery image as the main image.
This is usually a JavaScript conflict. Try:
Yes. Use [product_page id="123"] with the correct product ID.
That was a 3.0.10 regression on classic (PHP) themes: WooSwipe forced #wooswipe to width: 100%. Update to 3.0.12. Block themes (Twenty Twenty-Four / Twenty Twenty-Five) still use a full-width gallery inside their column.
#wooswipe { width:100% !important } for block-theme columns, which overrode WooCommerce’s 48% .images / .summary two-column layout (gallery stacked above product details). Full-width is now scoped to block themes only (body.wooswipe-block-gallery / product-image-gallery block).#wooswipe { width:100% !important } for block-theme columns, which overrode WooCommerce’s 48% .images / .summary two-column layout (gallery stacked above product details). Full-width is now scoped to block themes only (body.wooswipe-block-gallery / product-image-gallery block).woocommerce/product-image-gallery block instead of also dumping via classic hooks.images { width:48% } was shrinking WooSwipe inside the column)top: 35% → top: 50% + translateY)woocommerce_single_product_image_thumbnail_html now applies to the main image as well as thumbnailswooswipe_include_attachment filter to include/exclude gallery attachmentshide_thumbnails option correctly respected for simple productsmanage_options capability, sanitised colour fields[product_page] shortcode contextswoocommerce_single, woocommerce_gallery_thumbnail)product_page shortcode support (#20)