sonny12
Forum Replies Created
-
Forum: Developing with WordPress
In reply to: WordPress count postvar dump output
Forum: Developing with WordPress
In reply to: WordPress count post@1naveengiri,
the output in the browser is Array.

below is the code you gave
$args = array( 'post_type' => 'product', 'post_per_page' => -1, 'meta_query' => array( array( 'key' => 'product_family', 'value' => array( 'latest', 'car_navigation', 'car_recorder'), 'compare' => 'IN', ) ) ); $query = new WP_Query($args); $field_key = "product_family"; $field = get_field_object($field_key); echo $field;Forum: Developing with WordPress
In reply to: WordPress count postim using advanced custom field. i have post type name(product) and it has a fieldname(product_family) which is a select tag

i specify both value and label. this is what i want to be counted dynamically so that in the future if the client will add another value, the code will automatic count it.

hi @1naveengiri
i tried your code but the output is zero. And i want the select tag to be counted dynamically i cannot hardcode to put in array.please shed some lights on how to do this. thanks,
Forum: Developing with WordPress
In reply to: WordPress count posthi @1naveengiri
i tried your code but the output is zero. And i want the select tag to be counted dynamically i cannot hardcode to put in array.im using advanced custom field. i have post type name(product) and it has a fieldname(product_family) which is a select tag

i specify both value and label. this is what i want to be counted dynamically so that in the future if the client will add another value, the code will automatic count it.

please shed some lights on how to do this. thanks,
- This reply was modified 9 years, 4 months ago by sonny12.
- This reply was modified 9 years, 4 months ago by sonny12.
- This reply was modified 9 years, 4 months ago by sonny12.
- This reply was modified 9 years, 4 months ago by sonny12.
- This reply was modified 9 years, 4 months ago by sonny12.
- This reply was modified 9 years, 4 months ago by sonny12.
- This reply was modified 9 years, 4 months ago by sonny12.
Forum: Developing with WordPress
In reply to: WordPress count post@displaynone and @bcworkz. I wanted all the select tag value to be counted not the product mate. the fieldname for the select tag is (product_family) that is why i put meta_key for that but doesn’t do the trick.
Forum: Developing with WordPress
In reply to: How to make wordpress navigation menu localizeok. Any other option to do the trick? Because I need to have a navigation that has two language one for english (default) and second option for (arabic). I saw some sites that their navigation will translate to different language but I have no idea how they do it.