- This topic has 3 replies, 2 voices, and was last updated 1 month, 2 weeks ago by .
i am trying to do something like this in a loop:
(I removed the < >, so it is not displayed as an image here)
$query = new WP_Query( array( 'post_type' => 'bild' ) ); in the Loop: $bild = rwmb_the_value($field_id = "url_", $echo =false); echo 'img src="', $bild, '" /';'
I have two questions. First of all $echo = false does not work for me.
Everytime the Url is output into the HTML instead of just being returned to the variable.
How can I fix this?
Apart from the echo issue the first version is working, but i would prefer to use rwmb_the_value/rwmb_meta to get the url of a image that is selected by the advanced image field. So I my client can choose an image directly instead of having to search for the url. So to say:
$image = rwmb_the_value(or rmwb_meta?)( $field_id = 'field_id', array( 'size' => 'original' ), $echo = false)
echo 'img src="', $bild['url'], '" /';
I found something with rmwb_meta in the single image documentation but it did not work.
Can you provide me with the correct syntax please? And tell me how to resolve the echo issue?
Special thanks in advance
- You must be logged in to reply to this topic.