I need to hide only one of the 2 children of a fieldset element.
I have an issue with the assigning the #type='hidden' value to 2 children elements of a fieldset.
In other words I have:
Array
(
[4] => Array
(
[#type] => hidden
[#title] => Distribution Product
[#default_value] => Array
(
)
[#options] => Array
(
[] => - None selected -
[0] => stdClass Object
(
[option] => Array
(
[38] => Cosmetics
)
)
[1] => stdClass Object
(
[option] => Array
(
[39] => Hair
)
)
)
[#description] =>
[#multiple] => 0
[#size] => 0
[#weight] => 0
[#theme] => taxonomy_term_select
[#required] => 0
)
[1] => Array
(
[#type] => select
[#title] => Product
[#default_value] => Array
(
[0] => 26
)
[#options] => Array
(
[] => - None selected -
[0] => stdClass Object
(
[option] => Array
(
[28] => Cosmetics
)
)
[1] => stdClass Object
(
[option] => Array
(
[26] => -Joelle Ciocco
)
)
)
[#description] =>
[#multiple] => 0
[#size] => 0
[#weight] => 0
[#theme] => taxonomy_term_select
[#required] => 0
)
[#type] => fieldset
[#title] => Vocabularies
[#collapsible] => 1
[#collapsed] =>
[#weight] => -3
[#tree] => 1
)
I'm currectly assigning
$form['taxonomy'][4]['#type'] = 'hidden';
$form['taxonomy'][1]['#type'] = 'hidden';
But they are both visible.
Of course if I hide
$form['taxonomy']['#type'] = 'hidden';
it works and I hide everything.
thanks
What if you try
unset($form['taxonomy'][4]);
Related
I am on functions.php and I want to add this filter:
function graphene_alter_the_query( $request ) {
$dummy_query = new WP_Query();
$dummy_query->parse_query( $request );
if (!is_category('25')) {
$request['gdsr_sort'] = 'rating';
}
else {
$request['gdsr_sort'] = 'comment_count';
}
return $request;
}
add_filter( 'request', 'graphene_alter_the_query' );
the filter should do the same thing for all categories except cat 25 but seems like it cant tell it apart like if the IF condition is not detecting the category so I tried to debug it by looking at the values in WP_Query and I get this:
$myquery = new WP_Query(); print_r($myquery);
WP_Query Object ( [query] => Array ( [category_name] => 'my cat' ) [query_vars] => Array ( [category_name] => 'my cat' [error] => [m] => [p] => 0 [post_parent] => [subpost] => [subpost_id] => [attachment] => [attachment_id] => 0 [name] => [pagename] => [page_id] => 0 [second] => [minute] => [hour] => [day] => 0 [monthnum] => 0 [year] => 0 [w] => 0 [tag] => [cat] => [tag_id] => [author] => [author_name] => [feed] => [tb] => [paged] => 0 [meta_key] => [meta_value] => [preview] => [s] => [sentence] => [title] => [fields] => [menu_order] => [embed] => [category__in] => Array ( ) [category__not_in] => Array ( ) [category__and] => Array ( ) [post__in] => Array ( ) [post__not_in] => Array ( ) [post_name__in] => Array ( ) [tag__in] => Array ( ) [tag__not_in] => Array ( ) [tag__and] => Array ( ) [tag_slug__in] => Array ( ) [tag_slug__and] => Array ( ) [post_parent__in] => Array ( ) [post_parent__not_in] => Array ( ) [author__in] => Array ( ) [author__not_in] => Array ( ) ) [tax_query] => WP_Tax_Query Object ( [queries] => Array ( [0] => Array ( [taxonomy] => category [terms] => Array ( [0] => 'my cat' ) [field] => slug [operator] => IN [include_children] => 1 ) ) [relation] => AND [table_aliases:protected] => Array ( ) [queried_terms] => Array ( [category] => Array ( [terms] => Array ( [0] => 'my cat' ) [field] => slug ) ) [primary_table] => [primary_id_column] => ) [meta_query] => [date_query] => [post_count] => 0 [current_post] => -1 [in_the_loop] => [comment_count] => 0 [current_comment] => -1 [found_posts] => 0 [max_num_pages] => 0 [max_num_comment_pages] => 0 [is_single] => [is_preview] => [is_page] => [is_archive] => 1 [is_date] => [is_year] => [is_month] => [is_day] => [is_time] => [is_author] => [is_category] => 1 [is_tag] => [is_tax] => [is_search] => [is_feed] => [is_comment_feed] => [is_trackback] => [is_home] => [is_privacy_policy] => [is_404] => [is_embed] => [is_paged] => [is_admin] => [is_attachment] => [is_singular] => [is_robots] => [is_favicon] => [is_posts_page] => [is_post_type_archive] => [query_vars_hash:WP_Query:private] => 6d85cdf18f3e6a58a470a3002d5807fc [query_vars_changed:WP_Query:private] => [thumbnails_cached] => [stopwords:WP_Query:private] => [compat_fields:WP_Query:private] => Array ( [0] => query_vars_hash [1] => query_vars_changed ) [compat_methods:WP_Query:private] => Array ( [0] => init_query_flags [1] =>
but both tag_id and cat appear empty. Why is that?
I'm looking for way to get a specific Gutenbergblock from my post content to use in the archive template. Somewhere in my single post there's an iconlist (nested in a column and the column nested in a row) that I would like to use as a summary of the page in the entry on the archive page.
I wrote this code to search for the block called 'kadence/iconlist' and render it.
<?php $post_id = get_the_ID();
$post = get_post($post_id);
$blocks = parse_blocks($post->post_content);
foreach ($blocks as $block) {
if ($block['blockName'] == 'kadence/iconlist') {
echo render_block($block);
}
} ?>
This renders nothing because the 'kadence/iconlist' is nested. A var_dump of the $block shows this structure:
Array
(
[blockName] => kadence/rowlayout
[attrs] => Array
(
[uniqueID] => _94b9e4-63
[columnGutter] => wider
[colLayout] => equal
[maxWidth] => 1220
[topPadding] => 55
[bottomPadding] => 55
[overlayFirstOpacity] => 1
[overlaySecondOpacity] => 1
[overlayOpacity] => 90
[align] => full
[firstColumnWidth] => 50
[secondColumnWidth] => 50
)
[innerBlocks] => Array
(
[0] => Array
(
[blockName] => kadence/column
[attrs] => Array
(
[topPadding] => 25
[bottomPadding] => 25
[leftPadding] => 25
[rightPadding] => 25
[uniqueID] => _91ffee-25
)
[innerBlocks] => Array
(
[0] => Array
(
[blockName] => kadence/advancedgallery
[attrs] => Array
(
[uniqueID] => _ccc1ba-38
[columns] => Array
(
[0] => 2
[1] => 2
[2] => 2
[3] => 2
[4] => 1
[5] => 1
)
[thumbSize] => full
[ids] => Array
(
[0] => 355
[1] => 354
[2] => 357
[3] => 353
[4] => 351
[5] => 352
[6] => 349
[7] => 348
[8] => 350
)
[type] => thumbslider
[imageRatio] => square
[linkTo] => media
[gutter] => Array
(
[0] => 40
[1] =>
[2] =>
)
[imageRadius] => Array
(
[0] => 0
[1] => 0
[2] => 0
[3] => 0
)
[autoPlay] => 1
[autoSpeed] => 4000
[lightbox] => magnific
[margin] => Array
(
[0] => Array
(
[desk] => Array
(
[0] => 0
[1] => 0
[2] => 0
[3] => 0
)
[tablet] => Array
(
[0] =>
[1] =>
[2] =>
[3] =>
)
[mobile] => Array
(
[0] =>
[1] =>
[2] =>
[3] =>
)
)
)
[thumbnailRatio] => square
[thumbnailColumns] => Array
(
[0] => 4
[1] => 4
[2] => 4
[3] => 4
[4] => 4
[5] => 4
)
)
[innerBlocks] => Array
(
)
[innerHTML] =>
Previous
Next
Previous
Next
[innerContent] => Array
(
[0] =>
Previous
Next
)
)
)
[innerHTML] =>
[innerContent] => Array
(
[0] =>
[1] =>
[2] =>
)
)
[1] => Array
(
[blockName] => kadence/column
[attrs] => Array
(
[id] => 2
[uniqueID] => _b56b72-c0
)
[innerBlocks] => Array
(
[0] => Array
(
[blockName] => kadence/advancedheading
[attrs] => Array
(
[level] => 1
[uniqueID] => _1f94db-5b
)
[innerBlocks] => Array
(
)
[innerHTML] =>
RVS-200HD+
[innerContent] => Array
(
[0] =>
RVS-200HD+
)
)
[1] => Array
(
[blockName] => kadence/iconlist
[attrs] => Array
(
[items] => Array
(
[0] => Array
(
[icon] => fe_check
[link] =>
[target] => _self
[size] => 20
[text] => Voordeel nummer 1 iets met emmers
[width] => 2
[color] =>
[background] =>
[border] =>
[borderRadius] => 0
[borderWidth] => 1
[padding] => 5
[style] => default
)
[1] => Array
(
[icon] => fe_check
[link] =>
[target] => _self
[size] => 20
[text] => Puntje 2
[width] => 2
[color] =>
[background] =>
[border] =>
[borderRadius] => 0
[borderWidth] => 1
[padding] => 5
[style] => default
)
[2] => Array
(
[icon] => fe_check
[link] =>
[target] => _self
[size] => 20
[text] => Puntje 3, deze zijn per bericht gewoon aan te passen
[width] => 2
[color] =>
[background] =>
[border] =>
[borderRadius] => 0
[borderWidth] => 1
[padding] => 5
[style] => default
)
[3] => Array
(
[icon] => fe_check
[link] =>
[target] => _self
[size] => 20
[width] => 2
[color] =>
[background] =>
[border] =>
[borderRadius] => 0
[borderWidth] => 1
[padding] => 5
[style] => default
[text] => En toe te voegen
)
)
[listCount] => 4
[uniqueID] => _342687-70
)
[innerBlocks] => Array
(
)
[innerHTML] =>
Voordeel nummer 1 iets met emmers
Puntje 2
Puntje 3, deze zijn per bericht gewoon aan te passen
En toe te voegen
[innerContent] => Array
(
[0] =>
Voordeel nummer 1 iets met emmers
Puntje 2
Puntje 3, deze zijn per bericht gewoon aan te passen
En toe te voegen
)
)
[2] => Array
(
[blockName] => core/block
[attrs] => Array
(
[ref] => 918
)
[innerBlocks] => Array
(
)
[innerHTML] =>
[innerContent] => Array
(
)
)
)
[innerHTML] =>
[innerContent] => Array
(
[0] =>
[1] =>
[2] =>
[3] =>
[4] =>
[5] =>
[6] =>
)
)
)
[innerHTML] =>
[innerContent] => Array
(
[0] =>
[1] =>
[2] =>
[3] =>
[4] =>
)
)
Array
(
[blockName] =>
[attrs] => Array
(
)
[innerBlocks] => Array
(
)
[innerHTML] =>
[innerContent] => Array
(
[0] =>
)
)
How do I have to change the if($block['blockName'] == 'kadence/iconlist' to actually get to the kadence/iconlist block?
This question already has answers here:
Get Order items and WC_Order_Item_Product in WooCommerce 3
(2 answers)
Closed 5 years ago.
I have tried to get the product id and the product name by the following code:
if ( $query->have_posts() ) {
$order_id = $query->posts[0]->ID;
$order = new WC_Order( $order_id );
$items = $order->get_items();
}
foreach ( $items as $item ) {
$product_id = $item['product_id'];
$product = wc_get_product( $item_id );
$product_name = $item['name'];
}
In the above code I got the product name, but the it is return 0 for $product_id. Is there any other method for this?
I can't find any solution for this.
My Edited Version:
When I tried this:
$order_id = $query->posts[0]->ID;
$order = new WC_Order( $order_id );
$items = $order->get_items();
foreach ( $items as $item ) {
$item_id = $item['product_id'];
$product_name = $item['name'];
print_r( $item ); exit;
}
I got this array:
WC_Order_Item_Product Object
(
[extra_data:protected] => Array
(
[product_id] => 0
[variation_id] => 0
[quantity] => 1
[tax_class] =>
[subtotal] => 0
[subtotal_tax] => 0
[total] => 0
[total_tax] => 0
[taxes] => Array
(
[subtotal] => Array
(
)
[total] => Array
(
)
)
)
[data:protected] => Array
(
[order_id] => 684
[name] => Dark Skirt "Erebos" - Large, White
[product_id] => 0
[variation_id] => 0
[quantity] => 1
[tax_class] =>
[subtotal] => 19
[subtotal_tax] => 0
[total] => 19
[total_tax] => 0
[taxes] => Array
(
[total] => Array
(
)
[subtotal] => Array
(
)
)
)
[cache_group:protected] => order-items
[meta_type:protected] => order_item
[object_type:protected] => order_item
[id:protected] => 1
[changes:protected] => Array
(
)
[object_read:protected] => 1
[default_data:protected] => Array
(
[order_id] => 0
[name] =>
[product_id] => 0
[variation_id] => 0
[quantity] => 1
[tax_class] =>
[subtotal] => 0
[subtotal_tax] => 0
[total] => 0
[total_tax] => 0
[taxes] => Array
(
[subtotal] => Array
(
)
[total] => Array
(
)
)
)
[data_store:protected] => WC_Data_Store Object
(
[instance:WC_Data_Store:private] => WC_Order_Item_Product_Data_Store Object
(
[internal_meta_keys:protected] => Array
(
[0] => _order_id
[1] => _name
[2] => _product_id
[3] => _variation_id
[4] => _quantity
[5] => _tax_class
[6] => _subtotal
[7] => _subtotal_tax
[8] => _total
[9] => _total_tax
[10] => _taxes
[11] => _product_id
[12] => _variation_id
[13] => _qty
[14] => _tax_class
[15] => _line_subtotal
[16] => _line_subtotal_tax
[17] => _line_total
[18] => _line_tax
[19] => _line_tax_data
)
[meta_type:protected] => order_item
[object_id_field_for_meta:protected] => order_item_id
)
[stores:WC_Data_Store:private] => Array
(
[coupon] => WC_Coupon_Data_Store_CPT
[customer] => WC_Customer_Data_Store
[customer-download] => WC_Customer_Download_Data_Store
[customer-session] => WC_Customer_Data_Store_Session
[order] => WC_Order_Data_Store_CPT
[order-refund] => WC_Order_Refund_Data_Store_CPT
[order-item] => WC_Order_Item_Data_Store
[order-item-coupon] => WC_Order_Item_Coupon_Data_Store
[order-item-fee] => WC_Order_Item_Fee_Data_Store
[order-item-product] => WC_Order_Item_Product_Data_Store
[order-item-shipping] => WC_Order_Item_Shipping_Data_Store
[order-item-tax] => WC_Order_Item_Tax_Data_Store
[payment-token] => WC_Payment_Token_Data_Store
[product] => WC_Product_Data_Store_CPT
[product-grouped] => WC_Product_Grouped_Data_Store_CPT
[product-variable] => WC_Product_Variable_Data_Store_CPT
[product-variation] => WC_Product_Variation_Data_Store_CPT
[shipping-zone] => WC_Shipping_Zone_Data_Store
)
[current_class_name:WC_Data_Store:private] => WC_Order_Item_Product_Data_Store
[object_type:WC_Data_Store:private] => order-item-product
)
[meta_data:protected] => Array
(
)
)
Of you see the [data:protected] array, you can see this where the [product_id] is 0. That is the problem I guess. But what is the solution for this?
it should be:
foreach ( $items as $item ) {
$product = $item->get_product();
$product_id = $product->get_id();
}
i am using php excel to generate chart, but its not taking cell value. for reference you can refer http://uvresins.net/images/xls.png
My chart variable return :
PHPExcel_Chart Object
(
[_name:PHPExcel_Chart:private] => chart1
[_worksheet:PHPExcel_Chart:private] =>
[_title:PHPExcel_Chart:private] => PHPExcel_Chart_Title Object
(
[_caption:PHPExcel_Chart_Title:private] => Scgcc
[_layout:PHPExcel_Chart_Title:private] =>
)
[_legend:PHPExcel_Chart:private] => PHPExcel_Chart_Legend Object
(
[_position:PHPExcel_Chart_Legend:private] => tr
[_overlay:PHPExcel_Chart_Legend:private] =>
[_layout:PHPExcel_Chart_Legend:private] =>
)
[_xAxisLabel:PHPExcel_Chart:private] =>
[_yAxisLabel:PHPExcel_Chart:private] => PHPExcel_Chart_Title Object
(
[_caption:PHPExcel_Chart_Title:private] => Value ($k)
[_layout:PHPExcel_Chart_Title:private] =>
)
[_plotArea:PHPExcel_Chart:private] => PHPExcel_Chart_PlotArea Object
(
[_layout:PHPExcel_Chart_PlotArea:private] =>
[_plotSeries:PHPExcel_Chart_PlotArea:private] => Array
(
[0] => PHPExcel_Chart_DataSeries Object
(
[_plotType:PHPExcel_Chart_DataSeries:private] => lineChart
[_plotGrouping:PHPExcel_Chart_DataSeries:private] => stacked
[_plotDirection:PHPExcel_Chart_DataSeries:private] =>
[_plotStyle:PHPExcel_Chart_DataSeries:private] =>
[_plotOrder:PHPExcel_Chart_DataSeries:private] => Array
(
[0] => 0
[1] => 1
[2] => 2
)
[_plotLabel:PHPExcel_Chart_DataSeries:private] => Array
(
[0] => PHPExcel_Chart_DataSeriesValues Object
(
[_dataType:PHPExcel_Chart_DataSeriesValues:private] => String
[_dataSource:PHPExcel_Chart_DataSeriesValues:private] => Worksheet!$B$1
[_formatCode:PHPExcel_Chart_DataSeriesValues:private] =>
[_marker:PHPExcel_Chart_DataSeriesValues:private] =>
[_pointCount:PHPExcel_Chart_DataSeriesValues:private] => 1
[_dataValues:PHPExcel_Chart_DataSeriesValues:private] => Array
(
)
)
[1] => PHPExcel_Chart_DataSeriesValues Object
(
[_dataType:PHPExcel_Chart_DataSeriesValues:private] => String
[_dataSource:PHPExcel_Chart_DataSeriesValues:private] => Worksheet!$C$1
[_formatCode:PHPExcel_Chart_DataSeriesValues:private] =>
[_marker:PHPExcel_Chart_DataSeriesValues:private] =>
[_pointCount:PHPExcel_Chart_DataSeriesValues:private] => 1
[_dataValues:PHPExcel_Chart_DataSeriesValues:private] => Array
(
)
)
[2] => PHPExcel_Chart_DataSeriesValues Object
(
[_dataType:PHPExcel_Chart_DataSeriesValues:private] => String
[_dataSource:PHPExcel_Chart_DataSeriesValues:private] => Worksheet!$D$1
[_formatCode:PHPExcel_Chart_DataSeriesValues:private] =>
[_marker:PHPExcel_Chart_DataSeriesValues:private] =>
[_pointCount:PHPExcel_Chart_DataSeriesValues:private] => 1
[_dataValues:PHPExcel_Chart_DataSeriesValues:private] => Array
(
)
)
)
[_plotCategory:PHPExcel_Chart_DataSeries:private] => Array
(
[0] => PHPExcel_Chart_DataSeriesValues Object
(
[_dataType:PHPExcel_Chart_DataSeriesValues:private] => String
[_dataSource:PHPExcel_Chart_DataSeriesValues:private] => Worksheet!$A$2:$A$6
[_formatCode:PHPExcel_Chart_DataSeriesValues:private] =>
[_marker:PHPExcel_Chart_DataSeriesValues:private] =>
[_pointCount:PHPExcel_Chart_DataSeriesValues:private] => 5
[_dataValues:PHPExcel_Chart_DataSeriesValues:private] => Array
(
)
)
)
[_smoothLine:PHPExcel_Chart_DataSeries:private] =>
[_plotValues:PHPExcel_Chart_DataSeries:private] => Array
(
[0] => PHPExcel_Chart_DataSeriesValues Object
(
[_dataType:PHPExcel_Chart_DataSeriesValues:private] => Number
[_dataSource:PHPExcel_Chart_DataSeriesValues:private] => Worksheet!$B$2:$B$6
[_formatCode:PHPExcel_Chart_DataSeriesValues:private] =>
[_marker:PHPExcel_Chart_DataSeriesValues:private] =>
[_pointCount:PHPExcel_Chart_DataSeriesValues:private] => 5
[_dataValues:PHPExcel_Chart_DataSeriesValues:private] => Array
(
)
)
[1] => PHPExcel_Chart_DataSeriesValues Object
(
[_dataType:PHPExcel_Chart_DataSeriesValues:private] => Number
[_dataSource:PHPExcel_Chart_DataSeriesValues:private] => Worksheet!$C$2:$C$6
[_formatCode:PHPExcel_Chart_DataSeriesValues:private] =>
[_marker:PHPExcel_Chart_DataSeriesValues:private] =>
[_pointCount:PHPExcel_Chart_DataSeriesValues:private] => 5
[_dataValues:PHPExcel_Chart_DataSeriesValues:private] => Array
(
)
)
[2] => PHPExcel_Chart_DataSeriesValues Object
(
[_dataType:PHPExcel_Chart_DataSeriesValues:private] => Number
[_dataSource:PHPExcel_Chart_DataSeriesValues:private] => Worksheet!$D$2:$D$6
[_formatCode:PHPExcel_Chart_DataSeriesValues:private] =>
[_marker:PHPExcel_Chart_DataSeriesValues:private] =>
[_pointCount:PHPExcel_Chart_DataSeriesValues:private] => 5
[_dataValues:PHPExcel_Chart_DataSeriesValues:private] => Array
(
)
)
)
)
)
)
[_plotVisibleOnly:PHPExcel_Chart:private] => 1
[_displayBlanksAs:PHPExcel_Chart:private] => 0
[_topLeftCellRef:PHPExcel_Chart:private] => A13
[_topLeftXOffset:PHPExcel_Chart:private] => 0
[_topLeftYOffset:PHPExcel_Chart:private] => 0
[_bottomRightCellRef:PHPExcel_Chart:private] => H30
[_bottomRightXOffset:PHPExcel_Chart:private] => 10
[_bottomRightYOffset:PHPExcel_Chart:private] => 10
)
AND FromArray has value :
Array
(
[0] => Array
(
[0] =>
[1] => 12/2011
[2] => 01/2012
[3] => 02/2012
)
[1] => Array
(
[0] => QATAR
[1] => 102.77
[2] => 100
[3] => 102.13
)
[2] => Array
(
[0] => SAUDI ARABIA
[1] => 102.74
[2] => 100
[3] => 98.22
)
[3] => Array
(
[0] => KUWAIT
[1] => 94.82
[2] => 100
[3] => 102.28
)
[4] => Array
(
[0] => U.A.E.
[1] => 101.22
[2] => 100
[3] => 99.94
)
[5] => Array
(
[0] => OMAN
[1] => 101.73
[2] => 100
[3] => 100.42
)
)
Please tell me whats going wrong from my side, if nothing then y graph not appearing.
my content type, plan to have one or more 'maps'.
With the following php code, I can take all their link:
<?php print render($content['field_mappe_di_riferimento']); ?>
and I get the following result:
I would like to put before the link the image that is within the content type "Mappa", entered in the field "field_immagine_min."
this is the structure of my content type:
this is the content type "Mappa":
with: "print_r($field_mappe_di_riferimento);" I get it:
Array ( [0] => Array ( [nid] => 30 [access] => 1 [node] => stdClass Object ( [vid] => 30 [uid] => 1 [title] => Carta di Marignano, primo giorno, 13 Settembre 1515 [log] => [status] => 1 [comment] => 1 [promote] => 1 [sticky] => 0 [nid] => 30 [type] => mappa [language] => en [created] => 1352066743 [changed] => 1352127342 [tnid] => 0 [translate] => 0 [revision_timestamp] => 1352127342 [revision_uid] => 1 [field_battaglia_di_riferimento] => Array ( [und] => Array ( [0] => Array ( [nid] => 2 ) ) ) [field_immagine_std] => Array ( [und] => Array ( [0] => Array ( [fid] => 23 [alt] => [title] => [width] => 672 [height] => 554 [uid] => 1 [filename] => polesella.jpg [uri] => public://polesella_0.jpg [filemime] => image/jpeg [filesize] => 337755 [status] => 1 [timestamp] => 1352066743 [rdf_mapping] => Array ( ) ) ) ) [field_immagine_min] => Array ( [und] => Array ( [0] => Array ( [fid] => 24 [alt] => [title] => [width] => 150 [height] => 110 [uid] => 1 [filename] => polesella_small.jpg [uri] => public://polesella_small.jpg [filemime] => image/jpeg [filesize] => 10672 [status] => 1 [timestamp] => 1352066743 [rdf_mapping] => Array ( ) ) ) ) [field_testo_opzionale] => Array ( [und] => Array ( [0] => Array ( [value] => pisello [format] => [safe_value] => pisello ) ) ) [rdf_mapping] => Array ( [rdftype] => Array ( [0] => sioc:Item 1 => foaf:Document ) [title] => Array ( [predicates] => Array ( [0] => dc:title ) ) [created] => Array ( [predicates] => Array ( [0] => dc:date 1 => dc:created ) [datatype] => xsd:dateTime [callback] => date_iso8601 ) [changed] => Array ( [predicates] => Array ( [0] => dc:modified ) [datatype] => xsd:dateTime [callback] => date_iso8601 ) [body] => Array ( [predicates] => Array ( [0] => content:encoded ) ) [uid] => Array ( [predicates] => Array ( [0] => sioc:has_creator ) [type] => rel ) [name] => Array ( [predicates] => Array ( [0] => foaf:name ) ) [comment_count] => Array ( [predicates] => Array ( [0] => sioc:num_replies ) [datatype] => xsd:integer ) [last_activity] => Array ( [predicates] => Array ( [0] => sioc:last_activity_date ) [datatype] => xsd:dateTime [callback] => date_iso8601 ) ) [cid] => 0 [last_comment_timestamp] => 1352066743 [last_comment_name] => [last_comment_uid] => 1 [comment_count] => 0 [name] => ant [picture] => 0 [data] => b:0; ) ) )
so I tried to take the nid of the node that I want to take the picture, with success:
print ($content['field_mappe_di_riferimento']['#items'][0][nid]);
I get 30...
I found the solution:
$array = $content['field_mappe_di_riferimento']['#items'];
$k = 0;
foreach($array as $k => $v){
print($k);
//carico il nodo
$node = node_view(node_load($content['field_mappe_di_riferimento']['#items'][$k]['nid']));
//stampa l'img del nodo
print render($node['field_immagine_min']);
}