Custom Fields
Support Meta Box Builder frontpage & output picture, php error

  • Creator
  • #22605
    Resolved jw_bln

    I am using EXACT the method described in your own documentation to show a single image:

        $images = rwmb_meta( 'xximagefieldxx', array( 'limit' => 1 ) );
        $image = reset( $images );?>
    <img src="<?php echo $image['url'];?>" width="xx" height="xx>

    but getting a PHP error:
    WARNING: reset() expects parameter 1 to be array, string given in var/www/xxx/ eval()'dcode on line 3

    So what's wrong? Documentation?

    It's worth mentioning that currently only one picture is stored in the field...
    Seems reset( $images ) refers to the same Image ID (the only existing one), maybe this is the error.
    The picture itself is printed out to html.

    Any advice?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Author
  • #22608
    Long Nguyen


    The code sample code is working well on my local site. Please ensure that the field ID is correct and the code is added to the post's template.

    You can also share the code that creates the field image. I will take a closer look.


    Sorry for the late reply.
    I need to mention again, that
    a) The picture itself is shown on the frontend, only in oxygen page builder (backend) it shows this behavior
    b) I am using the graphical builder, so all is automatically added
    c) There is only one picture existing, but reset() is an array function??
    d) Fields are existing, otherwise the picture would not have been visible

    I will check with the Oxypagebuilder support too.

    Long Nguyen
Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.