Display Table On Specific Archive page (Category/Tag/Attribute page)
Time needed: 5 minutes
We have an option to display a table on every archive page like shop, category, tag, or attribute. You just have to turn on "Table on Archives" function.
But, if you want to show the table only some specific archive pages. For example, you have six categories, and you want to display a table with only one or two category pages. Let's do that.
- Go to the categories page
Navigate to Product->Categories.
- Edit Category
Now choose your category where you want to display the table and click edit.
- Select Table
On this page, you will see an option to select a table for this category. So select a table from the "Product Table" dropdown menu.
- Update and visit
Update and visit that category page. You will see the table on that category page.
Show Extra Table Before Category Page
You can also display another table before the category table, which does not include only this category's products. As an example, before showing the 'Hoodies' category products, you want to show another category's products. Or one or two extra products.
We can add shortcode in the category Description box. By default, this table will show only this category's products. We can change that by using shortcode atts. In this case, it's 'behavior'. Set behavior to normal.
So the shortcode will be like this [Product_Table id='2941' name='yu' behavior='normal']
So this table will display all the products from the store.
You can filter products inside the table's Query tab.
Helper links:
- Show Products by Type/ Visibility
- Show Products by Categories / Tag
- Hide Specific Categories Products
You can also pass product ids with shortcode. Like ids='1307,882'
Shortcode Example: [Product_Table id='2941' name='yu' behavior='normal' ids='1307,882']
So here the table will display only two products.
Note: With the last method you just need one table to show different products. You just need to change products ids.