SliceWP includes a variety of useful shortcodes that allow you to customize and enhance your affiliate program experience. These shortcodes can be used to display affiliate related content and functionality throughout your website, helping you create a seamless experience for both affiliates and visitors.
Below you’ll find a complete list of available shortcodes, along with details about their purpose, usage examples and supported attributes.
If you’re not sure what shortcodes are and how they work in your WordPress site, please click here to learn more.
[slicewp_affiliate_registration]
Outputs the affiliate registration form, where visitors of your website can register to your affiliate program.
Available attributes:
redirect_url(string)(optional) – The URL where the user will be redirected after successfully submitting the affiliate registration form. Click here to learn more about how user redirection works when this attribute is not provided.
Usage:
// Redirect the user after successful affiliate registration form submit.
[slicewp_affiliate_registration redirect_url="https://yourwebsite.com/landing-page-after-registration/"]
Quick note: You can learn more about the affiliate registration form and how to customize it by following this link.
[slicewp_affiliate_login]
Outputs the affiliate login form, which your affiliates can use to log into their account.
Available attributes:
redirect_url(string)(optional) – The URL where the user will be redirected after being logged in. Click here to learn more about how user redirection works when this attribute is not provided.
Usage:
// Redirect the user after successful login.
[slicewp_affiliate_login redirect_url="https://yourwebsite.com/landing-page-after-login/"]
Quick note: You can learn more about how the affiliate login form works by clicking this link.
[slicewp_affiliate_account]
Outputs the main affiliate area/dashboard, where your affiliates can log in to grab their referral link and to view their overall performance.
Available attributes:
menu_position(string)(optional) – Defines the position of the affiliate account menu. Accepted values areleftorright. When set to “left”, the menu is displayed in a left sidebar layout. When set to “right”, the menu is displayed in a right sidebar layout. If the attribute is not set, the menu is displayed horizontally at the top of the affiliate account page.
Usage:
// Displays the menu as a left sidebar.
[slicewp_affiliate_account menu_position="left"]
// Displays the menu as a right sidebar.
[slicewp_affiliate_account menu_position="right"]
Quick note: You can find more information about the affiliate account by clicking this link.
[slicewp_affiliate_reset_password]
Outputs a form where your affiliates can reset their account’s password.
You can find more information about the affiliate reset password form by clicking this link.
[slicewp_affiliate_id]
Outputs the unique ID of the currently logged-in affiliate.
[slicewp_affiliate_url]
By default, this shortcode outputs the currently logged-in affiliate’s referral link. However, you can modify the output based on the attributes you provide.
Available attributes:
affiliate_id(int)(optional) – An affiliate’s unique ID. If you provide an affiliate’s ID, the shortcode will output the referral link of the affiliate you provided, instead of the affiliate that is logged-in.url(string)(optional) – A link from your website. If you provide a link from your website, for example to a certain product or page, the outputted referral link will be for the given website link.
Usage:
// Outputs the default referral link for the currently logged-in affiliate.
[slicewp_affiliate_url]
// Transforms the given URL into a referral link for the currently logged-in affiliate.
[slicewp_affiliate_url url="https://yourwebsite.com/awesome-product/"]
// Outputs the default referral link of the affiliate with ID 21.
[slicewp_affiliate_url affiliate_id="21"]
// Transforms the given URL into a referral link for affiliate with ID 21 and outputs it.
[slicewp_affiliate_url affiliate_id="21" url="https://yourwebsite.com/awesome-product/"]
[slicewp_creative]
Outputs a given creative.
Available attributes:
id(int)(required) – The ID of the creative you wish to output.
Usage:
// Outputs the HTML for the creative with ID 21.
[slicewp_creative id="21"]