[wps_products]

shortcode

Since: v1.0.0

Source:

Displays products optionally filtered by attributes

Examples:

      
// Simple usage to show all products [wps_products] // Show products from collections "Featured" and "Sale". Limit the amount of products to 10. [wps_products collections="Featured, Sale" limit="10"] // Show products belonging to certain tags and ordered by price. [wps_products tags="vintage, cotton, food" orderby="price"] // Show products that contain the words "Limited offer" in the product description. [wps_products desc="Limited offer"]

Avaialble attributes:

  • titles

    Allows for filtering products that contain specific titles. Multiple values must be comma separated.

    Possible Values Example Default
    Any product title [wps_products titles="Product A, Another Great Product"] false
  • collections

    Allows for filtering products that contain specific collections. Multiple values must be comma separated.

    Possible Values Example Default
    Any collection title [wps_products collections="Featured, sale"] false
  • slugs

    Allows for filtering products that contain specific slugs. Multiple values must be comma separated.

    Possible Values Example Default
    Any product slug [wps_products slugs="product-a, product-b"] false
  • tags

    Allows for filtering products that contain specific tags. Multiple values must be comma separated.

    Possible Values Example Default
    Any tag name [wps_products tags="vintage, cotton, food"] false
  • vendors

    Allows for filtering products that contain specific vendors. Multiple values must be comma separated.

    Possible Values Example Default
    Any vendor name [wps_products vendors="Acme LLC"] false
  • types

    Allows for filtering products that contain specific types. Multiple values must be comma separated.

    Possible Values Example Default
    Any type name [wps_products types="books, toys"] false
  • variants

    Allows for filtering products that contain specific variants. Multiple values must be comma separated.

    Possible Values Example Default
    Any variant name [wps_products variants="small, blue"] false
  • options

    Allows for filtering products that contain specific options. Multiple values must be comma separated.

    Possible Values Example Default
    Any option name [wps_products options="size, color"] false
  • ids

    Allows for filtering products by ID. Can either be the Product ID found within Shopify or the WordPress Custom Post Type ID. Multiple values must be comma separated.

    Possible Values Example Default
    ID of Shopify product or WordPress CPT [wps_products ids="302784, 303017"] false
  • desc

    Allows for filtering products that contain something within the product description. Performs a fuzzy search which means if you use desc="app" then any products with the text "app" in it's description will be returned—even if it belongs to another word like "apples".

    Possible Values Example Default
    Any string of text. Does not search for HTML. [wps_products desc="Text found inside description"] false
  • orderby

    Allows for ordering products by a specific criteria like title or price.

    Possible Values Example Default
    title Order products by title false
    price Order products by price false
    published_at Order products by published date false
    updated_at Order products by most recently changed false
    vendor Order products by vendor name false
    Manual Allows for manually ordering products by attribute value position false
  • order

    Sorts products ascendingly or descendingly. Used in combination with the orderby attribute. Asc orders from the smallest to the largest. Desc orders from the largest to the smallest.

    Possible Values Example Default
    asc [wps_products order="asc"] false
    desc [wps_products order="desc"] true
  • limit

    Limits the amount of products returned.

    Possible Values Example Default
    Any positive number [wps_products limit="3"] Standard WordPress post count found in Settings - Reading. Can also be set from the plugin settings by changing the option "Products per page".
  • add-to-cart

    Shows add to cart and variant selection buttons below the product.

    Possible Values Example Default
    true [wps_products add-to-cart="true"] false
  • breadcrumbs

    Shows breadcrumbs above products. (Note: For this to work, breadcrumbs must be manually enabled first via the wps_breadcrumbs_show filter. Once enabled, you can toggle breadcrumbs for a specific shortcode by setting the value to false.)

    Possible Values Example Default
    true [wps_products breadcrumbs="false"] false
  • pagination

    Whether to show pagination below shortcode output. Shows by default.

    Possible Values Example Default
    false [wps_products pagination="false"] true
  • keep-permalinks

    Keeps the permalink structure to the current page URL when the shortcode output contains pagination. This allows the output to keep any custom shortcode filtering when navigating to page 2, page 3, etc.

    Possible Values Example Default
    true [wps_products keep-permalinks="true"] false
  • items-per-row

    Sets the amount of products to list per row.

    Possible Values Example Default
    Any positive number [wps_products items-per-row="5"] false
Copied!