Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter sonny12

    (@sonny12)

    var dump output
    acf

    Thread Starter sonny12

    (@sonny12)

    @1naveengiri,
    the output in the browser is Array.
    browser

    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;
    • 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.
    Thread Starter sonny12

    (@sonny12)

    im using advanced custom field. i have post type name(product) and it has a fieldname(product_family) which is a select tag
    acf

    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.
    acf2

    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,

    Thread Starter sonny12

    (@sonny12)

    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.

    im using advanced custom field. i have post type name(product) and it has a fieldname(product_family) which is a select tag
    acf

    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.
    acf2

    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.
    Thread Starter sonny12

    (@sonny12)

    @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.

    • 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.
    Thread Starter sonny12

    (@sonny12)

    ok. 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.

Viewing 6 replies - 1 through 6 (of 6 total)