Exclude term_id
-
I’ve inherited a page from another developer, the page is built back in 2013 and the customer just want me to do some quickfixes on it.
The wanted me to split Seasonal products into Easter- and Christmasproducts, I’ve made that split but on the pages that show regular products (they shouldn’t show Easter nor Christmas) still show them and I need to know how to exclude both from the regular products-pages. Here’s what I’ve got to work with, it’s not that pretty written.
The former developer defined the Seasonal products (SASONGSPRODUKTER) via functions.php
define('SASONGSPRODUKTER_TERM_ID', 12);And then excluded SASONGSPRODUKTER in the template for regular products with:
if (in_array($product_category->term_id, $usedCategories) && $product_category->term_id != SASONGSPRODUKTER_TERM_ID):And i added Christmas (JULPRODUKTER) and Easter (PASKPRODUKTER) to functions.php
define('SASONGSPRODUKTER_TERM_ID', 12); define('JULSPRODUKTER_TERM_ID', 21); define('PASKPRODUKTER_TERM_ID', 22);If I change SASONGSPRODUKTER to either JULPRODUKTER or PASKPRODUKTER, like this:
if (in_array($product_category->term_id, $usedCategories) && $product_category->term_id != PASKPRODUKTER_TERM_ID):I exclude Christmas OR Easter, so I know that works.
How do I either define SASONGSPRODUKTER to be 21 AND 22 instead of 12 (it doesn’t work with 21, 22)? Or add PASKPRODUKTER and JULPRODUKTER to the “if (in_array…”?
The topic ‘Exclude term_id’ is closed to new replies.