How to Get an Image To display based on Custom Field Value

Support General How to Get an Image To display based on Custom Field Value

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #44094
    collinsonfamily@gmail.com[email protected]
    Participant

    I'm trying to get an image/icon to be displayed on a custom post, based on the value of a custom field in that post. So for example, I have a "willing to help" custom field, with values of "Yes" or "No". If the value shows yes, the image or icon shows on the custom post.

    Can Meta Box do this? Any help gratefully received.

    Thanks in advance.

    #44099
    PeterPeter
    Moderator

    Hello,

    In the admin area, you can use the extension MB Conditional Logic to show/hide a field based on another field value.

    In the frontend, you can create an if statement to check a field value before outputting another field value. I think it is a simple code, like this.

    if( $willing_to_help_field == true ) {
        echo $icon_field;
    }
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.