I’m starting to getting along with PHP but I’m still learning, so I need some basic help.
I want to display only the value of the ‘mini-description’ in this array:
Array ( [0] => Array ( [name] => mini-description [value] => Suspendisse in tempus felis. [position] => 1 [is_visible] => 1 [is_variation] => 0 [is_taxonomy] => 0 ) )
and I’m trying to do this:
$postid = get_the_ID();
$mini = get_post_meta( $postid, '_product_attributes', array( 'mini-description' => 'value' ));
echo $mini;
But the result is: Array
Any solution? Thanks in advance.
try
or
If you need value of ‘mini-description’ only, you can use following code:
You need to test this in your code. Let me know if works.
In Woocommerce, you can do something like this:
Use
or
Edit use :
See the difference here : php var_dump() vs print_r()