Shortcodes
Place the gallery where the automatic placement doesn't reach: page builders, custom product templates or block layouts.
| Shortcode | Shows |
|---|---|
[siteryn_pgz_gallery] | The current product's gallery, on a product page. |
[siteryn_pgz_gallery id="123"] | A specific product's gallery. |
Copy it from the Shortcode card on the General tab. It uses your global settings and has one attribute, id; without it, the current product is used, and nothing shows if there is no product (or the ID isn't a product). With WPML or Polylang the ID follows the visitor's language. Pro adds a shortcode per gallery style (Gallery styles).
The gallery's styles and scripts load on single product pages with the gallery enabled. Off product pages, the shortcode shows unstyled images.
Template tag
<?php
if ( function_exists( 'siteryn_pgz_product_gallery' ) ) {
siteryn_pgz_product_gallery(); // current product, or siteryn_pgz_product_gallery( 123 )
}
?>
When to use them
- Your page builder has its own product images widget: replace it with the shortcode.
- Your block template uses WooCommerce's newer Product Gallery block: replace it with a Shortcode block.