Shortcode Usage
Introduction
AIPersonalize360 provides two powerful shortcodes for displaying product recommendations anywhere on your WordPress site. This guide covers everything you need to know about using these shortcodes effectively.
Available Shortcodes
1. General Product Recommendations
[aipers_product_recommendations]Displays personalized or popular product recommendations based on overall store data or user behavior (with AI).
- Use on: Home page, landing pages, blog posts, any page or widget
- Purpose: Show relevant products to engage visitors
2. Related Product Recommendations
[aipers_related_product_recommendations]Displays products related to the current product being viewed.
- Use on: Single product pages, product templates
- Purpose: Show similar or complementary products
Shortcode Attributes
Both shortcodes support the same attributes for customization:
title Attribute
Customizes the heading above the recommendations block.
[aipers_product_recommendations title="You May Like"]- Default: Uses title from plugin settings
- Type: Text string
- Example values: “Recommended for You”, “Trending Now”, “Popular Products”
description Attribute
Adds descriptive text below the title.
[aipers_product_recommendations description="Based on your browsing history"]- Default: Uses description from plugin settings
- Type: Text string
- Example values: “Customers also bought”, “Handpicked for you”
Usage Examples
Basic Usage (No Attributes)
Uses settings from AIPersonalize360 → Settings page:
[aipers_product_recommendations]This displays recommendations with the title and description configured in your plugin settings.
Custom Title Only
[aipers_product_recommendations title="Trending Now"]Overrides the title while keeping the default description.
Custom Title and Description
[aipers_product_recommendations title="You May Like" description="Based on popular items"]Customizes both title and description for this specific instance.
Related Products on Single Product Page
[aipers_related_product_recommendations title="Similar Products" description="Customers also viewed"]Shows products related to the current item with custom messaging.
Where to Use Shortcodes
Pages and Posts
- Edit any page or post
- Add a Shortcode block (or use Classic Editor)
- Enter the shortcode
- Preview and publish
Page Builders
Elementor
- Drag a Shortcode widget to your layout
- Paste the shortcode
- Save and view
Gutenberg Block Editor
- Click (+) to add a block
- Search for “Shortcode”
- Add the shortcode block
- Enter your shortcode
Classic Editor
Simply paste the shortcode directly into the content editor.
Widgets
- Go to Appearance → Widgets
- Add a “Shortcode” or “Custom HTML” widget
- Enter the shortcode
- Save
Theme Template Files (PHP)
For developers, add to theme templates:
<?php echo do_shortcode('[aipers_product_recommendations]'); ?>Strategic Placement Guide
Home Page
Recommended shortcode:
[aipers_product_recommendations title="Featured Products" description="Handpicked just for you"]Why: Engage new visitors with popular or personalized products.
Product Pages
Recommended shortcode:
[aipers_related_product_recommendations title="You May Also Like"]Why: Increase average order value with related products.
Blog Posts
Recommended shortcode:
[aipers_product_recommendations title="Shop Related Products" description="Products mentioned in this article"]Why: Monetize content with relevant product suggestions.
Cart Page
Recommended shortcode:
[aipers_product_recommendations title="Complete Your Purchase" description="Customers who bought these also bought"]Why: Last chance to increase order value before checkout.
Thank You Page
Recommended shortcode:
[aipers_product_recommendations title="Discover More" description="Continue shopping with these recommendations"]Why: Encourage repeat visits and future purchases.
Using Multiple Recommendation Blocks
You can add multiple shortcodes to the same page with different settings:
[aipers_product_recommendations title="Trending Now"]
[aipers_product_recommendations title="On Sale" description="Limited time offers"]
[aipers_product_recommendations title="New Arrivals"]Each block displays independently with its own title and description.
Multiple recommendation blocks on one page may impact loading speed. Use 2-3 blocks maximum per page for optimal performance.
Customization Tips
Title Best Practices
- Keep titles short (2-4 words)
- Use action-oriented language
- Match your brand voice
- Examples:
- “You May Like”
- “Trending Now”
- “Staff Picks”
- “Complete the Look”
Description Best Practices
- Optional but adds context
- One sentence maximum
- Explain why products are recommended
- Examples:
- “Based on your browsing”
- “Customers also bought”
- “Handpicked by our experts”
- “Limited time offers”
Contextual Messaging
Match your messaging to the page context:
- Category pages: “More from [Category]”
- Sale pages: “More Deals”
- New products: “Just Arrived”
- Seasonal: “Holiday Favorites”
Styling Recommendations
Recommendations inherit your theme’s WooCommerce product styling. To customize:
Using Theme Customizer
- Go to Appearance → Customize
- Look for WooCommerce → Product Catalog settings
- Adjust product grid styling
- Changes apply to recommendations too
Custom CSS (Advanced)
Add custom CSS to target recommendation blocks:
.aipers-recommendations {
/* Your custom styles */
}
.aipers-recommendations .product {
/* Style individual products */
}Shortcode Troubleshooting
Shortcode displays as text
- Ensure plugin is activated
- Check shortcode syntax (no typos)
- Verify you’re using Shortcode block (not Code block)
No products showing
- Ensure WooCommerce has published products
- Check “Show Number of Items” setting is > 0
- Verify products are in stock
Wrong products displaying
- Check AI Engine setting
- Verify Recombee connection (if using AI)
- Without AI, products based on ratings/sales/discounts
Styling looks broken
- Check theme WooCommerce compatibility
- Test with default WordPress theme
- Review browser console for CSS conflicts
Advanced Usage
Conditional Display (PHP)
Show recommendations only for specific conditions:
<?php
if ( is_user_logged_in() ) {
echo do_shortcode('[aipers_product_recommendations title="For You"]');
} else {
echo do_shortcode('[aipers_product_recommendations title="Popular Now"]');
}
?>Dynamic Attributes
Use PHP to generate dynamic titles:
<?php
$title = get_the_title() . ' - Related';
echo do_shortcode('[aipers_related_product_recommendations title="' . $title . '"]');
?>Was this article helpful?
Help us improve our documentation by providing feedback