- This topic has 7 replies, 3 voices, and was last updated 6 months ago by .
-
Topic
-
Troubles with single image. In the documentation:
https://docs.metabox.io/fields/single-image/
The documentation: I can use the helper function rwmb_meta() and this return an array of image information. However I am trying but the helper function only return an string with the ID of attachment.array ( 'id' => $prefix . 'if_vehiculos_imagen2', 'type' => 'single_image', 'name' => esc_html__( 'Imagen principal', 'text-domain' ), 'tab' => 'if_vehiculos_tab_general', ),
In my functions.php
$query = new WP_Query(array( 'post_type' => 'vehiculo', 'post_status' => 'publish', 'posts_per_page' => -1, )); while ($query->have_posts()) { $imagen = rwmb_meta('if_vehiculos_imagen2', array( 'size' => 'miniatura' ),$post_id ); var_dump($imagen); }
Full PHP code https://pastebin.com/KqXVBy7E
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- You must be logged in to reply to this topic.