Meta Box
Support › General › Show advanced image by post IDResolved
hi, i have a custom post type 'stock' with an advanced image field named 'photo'. I need to display the first image of my cpt (id=123) in a specific page. i've tried this, but this doesn't work
$images = rwmb_meta( 'photo', array( 'limit' => 1,'ID' => 123) ); $image = reset( $images );
Is it possible to do this ? if so, how?
Hi Jean,
The code to get a field from a post ID should be
$images = rwmb_meta( 'photo', array( 'limit' => 1 ), 123 );
For more information, please follow the documentation https://docs.metabox.io/rwmb-meta/#arguments
so simple! Thanks 🙂