PHP Issue

Support General PHP IssueResolved

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #35763
    Brent WilsonBrent Wilson
    Participant

    I have tried copying some PHP from this page: https://docs.metabox.io/fields/textarea/

    The code snippet is

    <?php $value = rwmb_meta( 'my_field_id' ) ?>
    <?= wpautop( $value ) ?>

    I tried changing out the my_field_id with the id from one of my fields.

    But I am unable to save the PHP as it apparently has some error(s) in it. What am I doing wrong?

    See screenshot here: https://i.postimg.cc/YSP0m0zq/Screen-Shot-2022-04-21-at-10-39-46-PM.png

    My goal is to have text from the text area include paragraph breaks on the front-end.

    #35770
    Long NguyenLong Nguyen
    Moderator

    Hi Brent,

    If you add the code to a file that has an open PHP tag, you need to add a close tag before adding the code

    ?> //here
    <?php $value = rwmb_meta( 'my_field_id' ) ?>
    <?= wpautop( $value ) ?>
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.