Shortcodes
Place the wishlist button or the wishlist itself anywhere: a custom product layout, a page builder or a theme template.
| Shortcode | Shows |
|---|---|
[siteryn_wishlist_button] | The Add/Remove button for the current product (inside a product loop or on a product page). |
[siteryn_wishlist_button product_id="123"] | The button for a specific product. |
[siteryn_wishlist] | The full wishlist. Pro adds layout="grid" / "list" and width="full" / "container". |
The shortcode button uses the single-product display (Icon + text by default) and the Space above setting. The shop-card Position, Spot on the image and Alignment options don't apply to it. In the block editor, use a Shortcode block. The General tab's Shortcodes card has Copy buttons.
In a theme template
<?php
if ( function_exists( 'siteryn_wishlist_button' ) ) {
siteryn_wishlist_button(); // or siteryn_wishlist_button( 123 );
}
?>
<a href="<?php echo esc_url( siteryn_wishlist_page_url() ); ?>">My wishlist</a>
When to use them
- Your theme's product cards still don't show the button (most themes are handled automatically).
- You use a block-based single product template.
- You want the button somewhere special, such as a quick view or a landing page.
To change the markup, override the templates from your theme: see Templates.