How to get customfield value by woocommerce product ID

If you look for all products with same ‘product_cip’ value try this: $a=array( ‘post_type’ => ‘product’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => – 1, ‘meta_query’ => array( array( ‘key’ => ‘product_cip’, ‘value’ => ‘some value’, ‘compare’=> ‘=’ ) ), ‘fields’ => ‘ids’ ); $b=get_posts($a); echo count($b); if you have get all products data $products_array=array(); foreach($b as … Read more

how can i use custom field in query post

Your meta_query needs to be a nested array, like so; $args = array( ‘posts_per_page’ => ‘5’, ‘cat’ => ‘3’, ‘orderby’ => ‘rand’, ‘meta_query’ => array( array( ‘key’ => ‘Featured List’, ‘value’ => ‘Yes’ ) ) ); And I get the feeling you don’t actually need a LIKE match – this’ll perform a loose comparison, and … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)