the best natural gift company

Content Product Attributes

  • attribute – Retrieves products using the specified attribute slug.
  • terms – Comma-separated list of attribute terms to be used with attribute.
  • terms_operator – Operator to compare attribute terms. Available options are:
    • AND – Will display products from all of the chosen attributes.
    • IN – Will display products with the chosen attribute. This is the default terms_operator value.
    • NOT IN – Will display products that are not in the chosen attributes.
  • tag_operator – Operator to compare tags. Available options are:
    • AND – Will display products from all of the chosen tags.
    • IN – Will display products with the chosen tags. This is the default tag_operator value.
    • NOT IN – Will display products that are not in the chosen tags.
  • visibility – Will display products based on the selected visibility. Available options are:
    • visible – Products visible on shop and search results. This is the default visibility option.
    • catalog – Products visible on the shop only, but not search results.
    • search – Products visible in search results only, but not on the shop.
    • hidden – Products that are hidden from both shop and search, accessible only by direct URL.
    • featured – Products that are marked as Featured Products.
  • category – Retrieves products using the specified category slug.
  • tag – Retrieves products using the specified tag slug.
  • cat_operator – Operator to compare category terms. Available options are:
    • AND – Will display products that belong in all of the chosen categories.
    • IN – Will display products within the chosen category. This is the default cat_operator value.
    • NOT IN – Will display products that are not in the chosen category.
  • ids – Will display products based on a comma-separated list of Post IDs.
  • skus – Will display products based on a comma-separated list of SKUs.

If the product is not showing, make sure it is not set to “Hidden” in the “Catalog Visibility”.

To find the Product ID, go to the Products screen, hover over the product and the ID appears as shown below.

Finding the WooCommerce product ID by hovering over a product

Special Product Attributes

These attributes cannot be used with the “Content Attributes” listed above, as they will likely cause a conflict and not display. You should only use one of the following special attributes.

  • best_selling – Will display your best selling products. Must be set to true.
  • on_sale – Will display your on-sale products. Must be set to true.

Examples of Product Scenarios

In the following scenarios, we’ll use an example clothing store.

Scenario 1 – Random Sale Items

I want to display four random on sale products.

This shortcode explicity states four products 

rfdtfyufgyftfytfytfytfy

Leave a Reply

Shopping cart

0
image/svg+xml

No products in the cart.

Continue Shopping