General Shortcode Guide

Recomendo supports displaying recommendations anywhere in your WordPress site by using a shortcode with different variations which can be used to achieve a lot more than what you may have thought that you could do.

Simply use the following shortcode anywhere on your WordPress site:

[recomendo type="personalized" number="3" template="content-product"]
  • This shortcode will display 3 personalized recommendations using the template part file “content-product.php” from your child or parent theme.

Please continue reading below to learn how to use the different parameters for the shortcode.

 

Shortcode parameters:

 

type (string)

The shortcode parameter (“type”) specifies the type of recommendations to show.

Example:

Display personalized recommendations:

[recomendo type="personalized"]
  •  Personalized is the default type used and may be omitted. 

 

Display Similar Items  (Up-sell) recommendations:

[recomendo type="similar"]
  •  Similar item recommendations should be displayed in single item pages.

 

Display complementary items recommendations (Cross-sell):

 [recomendo type="complementary"]
  •  Complementary needs items in the WooCommerce Cart in order to display its recommendations.

 

Display trending items recommendations (Popular products):

[recomendo type="trending"]

 

number (integer or string)

The shortcode parameter (“number”) specifies the number of items to display.

Example:

[recomendo type="similar" number="3"]
  • By default displays 16 items if the number the parameter is omitted.

 

template (string)

The shortcode parameter (“template”) specifies the template part file of your child theme (if present) or parent theme responsible for displaying the recommendations. The template part file should be developed according to WordPress standards, where the template part gets called from inside a WordPress loop.

Example:

[recomendo type="similar" number="3" template="content-product"]
  • This will use the file content-product.php of your child theme (if present) or parent theme. If you are using content-product.php. 
  • content-product.php is the default value for this parameter if you have selected “Product” as the post type to recommend in the Recomendo dashboard and WooCommerce is installed and active.
  • If not using WooCommerce it will default the the template file content-{myPostType}.php where {myPostType} is the post type configured in the Recomendo dashboard.
[recomendo type="similar" number="3" template="featured-posts"]
  • This will use the file featured-posts.php of your child theme (if present) or parent theme. (You should have selected “Post” as post type to recommend in the Recomendo dashboard).