'how added new Condition (if) wordpress costum field
We have this code to display the custom field in WordPress
if( isset($digi) && !empty($digi) )
Now we want to add a new condition (check in terms of being categorized) That's how we did it
if( isset(product_categories=55,56,57,58) || isset($digi) && !empty($digi) )
Is it correct?
Solution 1:[1]
I am not sure in what file or loop you perform this code, but your solution might be something similair to this:
$your_category = "THE CATEGORY YOU WANT TO CHECK FOR";
$product_categories = array(55,56,57,58);
if( in_array($your_categroy, $product_categories) || ( isset($digi) && !empty($digi) ) )
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
