• Resolved theas91

    (@theas91)


    Ive never done this before and Im kind of stuck, hoping someone can help!

    Ive added a checkmark option inside posts to check off when content is “premium.” If its checked off, I want it to show on the front page of the blog with the text “premium.”

    How can I get it to display in the front end? Ive used this code

    echo rwmb_meta( $premium, 1);

    But obviously that doesnt know what to display. Help REALLY appreciated! 😀

    https://wordpress.org/plugins/meta-box/

Viewing 1 replies (of 1 total)
  • Plugin Contributor Manny Fleurmond

    (@funkatronic)

    rwmb_meta will return either 0 for unchecked or 1 for checked, so you can use a if statement to display something based on that:

    if( rwmb_meta( $premium ) )
        echo 'Checked';
    else
        echo 'not checked';

    or

    echo rwmb_meta( $premium ) ? 'checked' : 'Not Checked';

    or use rwmb_the_value, which takes the same arguments and will return Yes or No based on if it was checked or not

Viewing 1 replies (of 1 total)

The topic ‘Display checkmark in front end?’ is closed to new replies.